diff options
author | Ron Yorston <rmy@pobox.com> | 2024-01-02 09:38:11 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2024-01-17 11:57:42 +0000 |
commit | 99d22da0e95d8356239c63199eb03f70adbf7a61 (patch) | |
tree | d7ce8b095e41d5db964f686acd3c1481a1f9b5da | |
parent | c0b57922a9373395c58139b2d4fe4cd865ef8223 (diff) | |
download | busybox-w32-99d22da0e95d8356239c63199eb03f70adbf7a61.tar.gz busybox-w32-99d22da0e95d8356239c63199eb03f70adbf7a61.tar.bz2 busybox-w32-99d22da0e95d8356239c63199eb03f70adbf7a61.zip |
Remove FAST_FUNC from variadic functions
The GCC documentation points out that the stdcall attribute doesn't
apply to functions which take a variable number of arguments. GCC
is silent about this during compilation but clang complains noisily.
Remove FAST_FUNC from all variadic functions. This has no effect
whatsoever on the binary resulting from a default 32-bit build.
Signed-off-by: Ron Yorston <rmy@pobox.com>
-rw-r--r-- | include/libbb.h | 24 | ||||
-rw-r--r-- | libbb/getopt32.c | 4 | ||||
-rw-r--r-- | libbb/herror_msg.c | 4 | ||||
-rw-r--r-- | libbb/perror_msg.c | 4 | ||||
-rw-r--r-- | libbb/verror_msg.c | 6 | ||||
-rw-r--r-- | libbb/xfuncs_printf.c | 6 |
6 files changed, 24 insertions, 24 deletions
diff --git a/include/libbb.h b/include/libbb.h index 6549c8c83..96496169d 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -980,7 +980,7 @@ int bb_putchar(int ch) FAST_FUNC; | |||
980 | /* Note: does not use stdio, writes to fd 2 directly */ | 980 | /* Note: does not use stdio, writes to fd 2 directly */ |
981 | int bb_putchar_stderr(char ch) FAST_FUNC; | 981 | int bb_putchar_stderr(char ch) FAST_FUNC; |
982 | int fputs_stdout(const char *s) FAST_FUNC; | 982 | int fputs_stdout(const char *s) FAST_FUNC; |
983 | char *xasprintf(const char *format, ...) __attribute__ ((format(printf, 1, 2))) FAST_FUNC RETURNS_MALLOC; | 983 | char *xasprintf(const char *format, ...) __attribute__ ((format(printf, 1, 2))) RETURNS_MALLOC; |
984 | char *auto_string(char *str) FAST_FUNC; | 984 | char *auto_string(char *str) FAST_FUNC; |
985 | // gcc-4.1.1 still isn't good enough at optimizing it | 985 | // gcc-4.1.1 still isn't good enough at optimizing it |
986 | // (+200 bytes compared to macro) | 986 | // (+200 bytes compared to macro) |
@@ -1416,12 +1416,12 @@ char* single_argv(char **argv) FAST_FUNC; | |||
1416 | char **skip_dash_dash(char **argv) FAST_FUNC; | 1416 | char **skip_dash_dash(char **argv) FAST_FUNC; |
1417 | extern const char *const bb_argv_dash[]; /* { "-", NULL } */ | 1417 | extern const char *const bb_argv_dash[]; /* { "-", NULL } */ |
1418 | extern uint32_t option_mask32; | 1418 | extern uint32_t option_mask32; |
1419 | uint32_t getopt32(char **argv, const char *applet_opts, ...) FAST_FUNC; | 1419 | uint32_t getopt32(char **argv, const char *applet_opts, ...); |
1420 | # define No_argument "\0" | 1420 | # define No_argument "\0" |
1421 | # define Required_argument "\001" | 1421 | # define Required_argument "\001" |
1422 | # define Optional_argument "\002" | 1422 | # define Optional_argument "\002" |
1423 | #if ENABLE_LONG_OPTS | 1423 | #if ENABLE_LONG_OPTS |
1424 | uint32_t getopt32long(char **argv, const char *optstring, const char *longopts, ...) FAST_FUNC; | 1424 | uint32_t getopt32long(char **argv, const char *optstring, const char *longopts, ...); |
1425 | #else | 1425 | #else |
1426 | #define getopt32long(argv,optstring,longopts,...) \ | 1426 | #define getopt32long(argv,optstring,longopts,...) \ |
1427 | getopt32(argv,optstring,##__VA_ARGS__) | 1427 | getopt32(argv,optstring,##__VA_ARGS__) |
@@ -1496,17 +1496,17 @@ extern uint8_t xfunc_error_retval; | |||
1496 | extern void (*die_func)(void); | 1496 | extern void (*die_func)(void); |
1497 | void xfunc_die(void) NORETURN FAST_FUNC; | 1497 | void xfunc_die(void) NORETURN FAST_FUNC; |
1498 | void bb_show_usage(void) NORETURN FAST_FUNC; | 1498 | void bb_show_usage(void) NORETURN FAST_FUNC; |
1499 | void bb_error_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))) FAST_FUNC; | 1499 | void bb_error_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))); |
1500 | void bb_simple_error_msg(const char *s) FAST_FUNC; | 1500 | void bb_simple_error_msg(const char *s) FAST_FUNC; |
1501 | void bb_error_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2))) FAST_FUNC; | 1501 | void bb_error_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2))); |
1502 | void bb_simple_error_msg_and_die(const char *s) NORETURN FAST_FUNC; | 1502 | void bb_simple_error_msg_and_die(const char *s) NORETURN FAST_FUNC; |
1503 | void bb_perror_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))) FAST_FUNC; | 1503 | void bb_perror_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))); |
1504 | void bb_simple_perror_msg(const char *s) FAST_FUNC; | 1504 | void bb_simple_perror_msg(const char *s) FAST_FUNC; |
1505 | void bb_perror_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2))) FAST_FUNC; | 1505 | void bb_perror_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2))); |
1506 | void bb_simple_perror_msg_and_die(const char *s) NORETURN FAST_FUNC; | 1506 | void bb_simple_perror_msg_and_die(const char *s) NORETURN FAST_FUNC; |
1507 | void bb_herror_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))) FAST_FUNC; | 1507 | void bb_herror_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))); |
1508 | void bb_simple_herror_msg(const char *s) FAST_FUNC; | 1508 | void bb_simple_herror_msg(const char *s) FAST_FUNC; |
1509 | void bb_herror_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2))) FAST_FUNC; | 1509 | void bb_herror_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2))); |
1510 | void bb_simple_herror_msg_and_die(const char *s) NORETURN FAST_FUNC; | 1510 | void bb_simple_herror_msg_and_die(const char *s) NORETURN FAST_FUNC; |
1511 | void bb_perror_nomsg_and_die(void) NORETURN FAST_FUNC; | 1511 | void bb_perror_nomsg_and_die(void) NORETURN FAST_FUNC; |
1512 | void bb_perror_nomsg(void) FAST_FUNC; | 1512 | void bb_perror_nomsg(void) FAST_FUNC; |
@@ -1522,7 +1522,7 @@ void bb_logenv_override(void) FAST_FUNC; | |||
1522 | typedef smalluint exitcode_t; | 1522 | typedef smalluint exitcode_t; |
1523 | 1523 | ||
1524 | #if ENABLE_FEATURE_SYSLOG_INFO | 1524 | #if ENABLE_FEATURE_SYSLOG_INFO |
1525 | void bb_info_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))) FAST_FUNC; | 1525 | void bb_info_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))); |
1526 | void bb_simple_info_msg(const char *s) FAST_FUNC; | 1526 | void bb_simple_info_msg(const char *s) FAST_FUNC; |
1527 | void bb_vinfo_msg(const char *s, va_list p) FAST_FUNC; | 1527 | void bb_vinfo_msg(const char *s, va_list p) FAST_FUNC; |
1528 | #else | 1528 | #else |
@@ -1898,8 +1898,8 @@ int get_termios_and_make_raw(int fd, struct termios *newterm, struct termios *ol | |||
1898 | int set_termios_to_raw(int fd, struct termios *oldterm, int flags) FAST_FUNC; | 1898 | int set_termios_to_raw(int fd, struct termios *oldterm, int flags) FAST_FUNC; |
1899 | 1899 | ||
1900 | /* NB: "unsigned request" is crucial! "int request" will break some arches! */ | 1900 | /* NB: "unsigned request" is crucial! "int request" will break some arches! */ |
1901 | int ioctl_or_perror(int fd, unsigned request, void *argp, const char *fmt,...) __attribute__ ((format (printf, 4, 5))) FAST_FUNC; | 1901 | int ioctl_or_perror(int fd, unsigned request, void *argp, const char *fmt,...) __attribute__ ((format (printf, 4, 5))); |
1902 | int ioctl_or_perror_and_die(int fd, unsigned request, void *argp, const char *fmt,...) __attribute__ ((format (printf, 4, 5))) FAST_FUNC; | 1902 | int ioctl_or_perror_and_die(int fd, unsigned request, void *argp, const char *fmt,...) __attribute__ ((format (printf, 4, 5))); |
1903 | #if ENABLE_IOCTL_HEX2STR_ERROR | 1903 | #if ENABLE_IOCTL_HEX2STR_ERROR |
1904 | int bb_ioctl_or_warn(int fd, unsigned request, void *argp, const char *ioctl_name) FAST_FUNC; | 1904 | int bb_ioctl_or_warn(int fd, unsigned request, void *argp, const char *ioctl_name) FAST_FUNC; |
1905 | int bb_xioctl(int fd, unsigned request, void *argp, const char *ioctl_name) FAST_FUNC; | 1905 | int bb_xioctl(int fd, unsigned request, void *argp, const char *ioctl_name) FAST_FUNC; |
diff --git a/libbb/getopt32.c b/libbb/getopt32.c index e861d0567..56040e150 100644 --- a/libbb/getopt32.c +++ b/libbb/getopt32.c | |||
@@ -595,7 +595,7 @@ vgetopt32(char **argv, const char *applet_opts, const char *applet_long_options, | |||
595 | return (int32_t)-1; | 595 | return (int32_t)-1; |
596 | } | 596 | } |
597 | 597 | ||
598 | uint32_t FAST_FUNC | 598 | uint32_t |
599 | getopt32(char **argv, const char *applet_opts, ...) | 599 | getopt32(char **argv, const char *applet_opts, ...) |
600 | { | 600 | { |
601 | uint32_t opt; | 601 | uint32_t opt; |
@@ -608,7 +608,7 @@ getopt32(char **argv, const char *applet_opts, ...) | |||
608 | } | 608 | } |
609 | 609 | ||
610 | #if ENABLE_LONG_OPTS | 610 | #if ENABLE_LONG_OPTS |
611 | uint32_t FAST_FUNC | 611 | uint32_t |
612 | getopt32long(char **argv, const char *applet_opts, const char *longopts, ...) | 612 | getopt32long(char **argv, const char *applet_opts, const char *longopts, ...) |
613 | { | 613 | { |
614 | uint32_t opt; | 614 | uint32_t opt; |
diff --git a/libbb/herror_msg.c b/libbb/herror_msg.c index a7dd98679..09537ae92 100644 --- a/libbb/herror_msg.c +++ b/libbb/herror_msg.c | |||
@@ -8,7 +8,7 @@ | |||
8 | */ | 8 | */ |
9 | #include "libbb.h" | 9 | #include "libbb.h" |
10 | 10 | ||
11 | void FAST_FUNC bb_herror_msg(const char *s, ...) | 11 | void bb_herror_msg(const char *s, ...) |
12 | { | 12 | { |
13 | va_list p; | 13 | va_list p; |
14 | 14 | ||
@@ -17,7 +17,7 @@ void FAST_FUNC bb_herror_msg(const char *s, ...) | |||
17 | va_end(p); | 17 | va_end(p); |
18 | } | 18 | } |
19 | 19 | ||
20 | void FAST_FUNC bb_herror_msg_and_die(const char *s, ...) | 20 | void bb_herror_msg_and_die(const char *s, ...) |
21 | { | 21 | { |
22 | va_list p; | 22 | va_list p; |
23 | 23 | ||
diff --git a/libbb/perror_msg.c b/libbb/perror_msg.c index fa1f0d339..32adb8c38 100644 --- a/libbb/perror_msg.c +++ b/libbb/perror_msg.c | |||
@@ -8,7 +8,7 @@ | |||
8 | */ | 8 | */ |
9 | #include "libbb.h" | 9 | #include "libbb.h" |
10 | 10 | ||
11 | void FAST_FUNC bb_perror_msg(const char *s, ...) | 11 | void bb_perror_msg(const char *s, ...) |
12 | { | 12 | { |
13 | va_list p; | 13 | va_list p; |
14 | 14 | ||
@@ -18,7 +18,7 @@ void FAST_FUNC bb_perror_msg(const char *s, ...) | |||
18 | va_end(p); | 18 | va_end(p); |
19 | } | 19 | } |
20 | 20 | ||
21 | void FAST_FUNC bb_perror_msg_and_die(const char *s, ...) | 21 | void bb_perror_msg_and_die(const char *s, ...) |
22 | { | 22 | { |
23 | va_list p; | 23 | va_list p; |
24 | 24 | ||
diff --git a/libbb/verror_msg.c b/libbb/verror_msg.c index 74b608f4c..7c167d912 100644 --- a/libbb/verror_msg.c +++ b/libbb/verror_msg.c | |||
@@ -156,7 +156,7 @@ void FAST_FUNC bb_verror_msg(const char *s, va_list p, const char* strerr) | |||
156 | #endif | 156 | #endif |
157 | 157 | ||
158 | 158 | ||
159 | void FAST_FUNC bb_error_msg_and_die(const char *s, ...) | 159 | void bb_error_msg_and_die(const char *s, ...) |
160 | { | 160 | { |
161 | va_list p; | 161 | va_list p; |
162 | 162 | ||
@@ -166,7 +166,7 @@ void FAST_FUNC bb_error_msg_and_die(const char *s, ...) | |||
166 | xfunc_die(); | 166 | xfunc_die(); |
167 | } | 167 | } |
168 | 168 | ||
169 | void FAST_FUNC bb_error_msg(const char *s, ...) | 169 | void bb_error_msg(const char *s, ...) |
170 | { | 170 | { |
171 | va_list p; | 171 | va_list p; |
172 | 172 | ||
@@ -183,7 +183,7 @@ void FAST_FUNC bb_vinfo_msg(const char *s, va_list p) | |||
183 | syslog_level = LOG_ERR; | 183 | syslog_level = LOG_ERR; |
184 | } | 184 | } |
185 | 185 | ||
186 | void FAST_FUNC bb_info_msg(const char *s, ...) | 186 | void bb_info_msg(const char *s, ...) |
187 | { | 187 | { |
188 | va_list p; | 188 | va_list p; |
189 | 189 | ||
diff --git a/libbb/xfuncs_printf.c b/libbb/xfuncs_printf.c index a9add8ab2..0ead3b2eb 100644 --- a/libbb/xfuncs_printf.c +++ b/libbb/xfuncs_printf.c | |||
@@ -336,7 +336,7 @@ void FAST_FUNC xprint_and_close_file(FILE *file) | |||
336 | 336 | ||
337 | // Die with an error message if we can't malloc() enough space and do an | 337 | // Die with an error message if we can't malloc() enough space and do an |
338 | // sprintf() into that space. | 338 | // sprintf() into that space. |
339 | char* FAST_FUNC xasprintf(const char *format, ...) | 339 | char* xasprintf(const char *format, ...) |
340 | { | 340 | { |
341 | va_list p; | 341 | va_list p; |
342 | int r; | 342 | int r; |
@@ -552,7 +552,7 @@ void FAST_FUNC selinux_or_die(void) | |||
552 | #endif | 552 | #endif |
553 | 553 | ||
554 | #if !ENABLE_PLATFORM_MINGW32 | 554 | #if !ENABLE_PLATFORM_MINGW32 |
555 | int FAST_FUNC ioctl_or_perror_and_die(int fd, unsigned request, void *argp, const char *fmt,...) | 555 | int ioctl_or_perror_and_die(int fd, unsigned request, void *argp, const char *fmt,...) |
556 | { | 556 | { |
557 | int ret; | 557 | int ret; |
558 | va_list p; | 558 | va_list p; |
@@ -568,7 +568,7 @@ int FAST_FUNC ioctl_or_perror_and_die(int fd, unsigned request, void *argp, cons | |||
568 | return ret; | 568 | return ret; |
569 | } | 569 | } |
570 | 570 | ||
571 | int FAST_FUNC ioctl_or_perror(int fd, unsigned request, void *argp, const char *fmt,...) | 571 | int ioctl_or_perror(int fd, unsigned request, void *argp, const char *fmt,...) |
572 | { | 572 | { |
573 | va_list p; | 573 | va_list p; |
574 | int ret = ioctl(fd, request, argp); | 574 | int ret = ioctl(fd, request, argp); |