← Commit list

d29337580

Bernhard Reutner-Fischer
Bernhard Reutner-Fischer
2006-05-26
SOURCE BUG Duration: 38s

Subject

- use strtol instead of strtoll if the latter does not exist - add and use wrapper for attribute - add and use replacement for vasprintf if it is unavailable

SOURCE BUG

This commit was genuinely broken at the time (not related to our build system): scripts/config/mkconfigs.c (2005-08-01 - 2006-10-05 arasi) uretilen bbconfigopts.h icine .config satirlarini kacissiz, ham newline'larla gömüyordu - gecerli C degildi, busybox'un kendi bb_mkdep araci bile parse edemiyordu (7d219aab7 ile duzeltildi, mkconfigs shell scripte cevrildi)

→ Bu hatanin tam hikayesini ve duzeltme diffini gor

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

scripts/bb_mkdep.c+19 -3
@@ -69,10 +69,19 @@
#include <fcntl.h>
#include <limits.h>
+#ifdef __GNUC__
+#define ATTRIBUTE __attribute__
+#else
+#define ATTRIBUTE(a) /* nothing */
+#endif
+
+#if !(defined __USE_ISOC99 || (defined __GLIBC_HAVE_LONG_LONG && defined __USE_MISC))
+#define strtoll strtol
+#endif
/* partial and simplified libbb routine */
-static void bb_error_d(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2)));
-static char * bb_asprint(const char *format, ...) __attribute__ ((format (printf, 1, 2)));
+static void bb_error_d(const char *s, ...) ATTRIBUTE ((noreturn, format (printf, 1, 2)));
+static char * bb_asprint(const char *format, ...) ATTRIBUTE ((format (printf, 1, 2)));
static char *bb_simplify_path(const char *path);
/* stolen from libbb as is */
@@ -1598,7 +1607,7 @@ static void scan_dir_find_ch_files(const char *p)
}
}
-static void show_usage(void) __attribute__ ((noreturn));
+static void show_usage(void) ATTRIBUTE ((noreturn));
static void show_usage(void)
{
bb_error_d("%s\n%s\n", bb_mkdep_terse_options, bb_mkdep_full_options);
@@ -1720,9 +1729,16 @@ static char *bb_asprint(const char *format, ...)
int r;
char *out;
+#ifdef __USE_GNU
va_start(p, format);
r = vasprintf(&out, format, p);
va_end(p);
+#else
+ out = xmalloc(BUFSIZ);
+ va_start(p, format);
+ r = vsprintf(out, format, p);
+ va_end(p);
+#endif
if (r < 0)
bb_error_d("bb_asprint: %m");