[PATCH] Remove FAST_FUNC from variadic functions
Ron Yorston
rmy at pobox.com
Tue Jan 2 09:49:40 UTC 2024
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 at pobox.com>
---
include/libbb.h | 24 ++++++++++++------------
libbb/getopt32.c | 4 ++--
libbb/herror_msg.c | 4 ++--
libbb/perror_msg.c | 4 ++--
libbb/verror_msg.c | 6 +++---
libbb/xfuncs_printf.c | 6 +++---
6 files changed, 24 insertions(+), 24 deletions(-)
diff --git a/include/libbb.h b/include/libbb.h
index ef5d04713..6ef090a0e 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -926,7 +926,7 @@ int bb_putchar(int ch) FAST_FUNC;
/* Note: does not use stdio, writes to fd 2 directly */
int bb_putchar_stderr(char ch) FAST_FUNC;
int fputs_stdout(const char *s) FAST_FUNC;
-char *xasprintf(const char *format, ...) __attribute__ ((format(printf, 1, 2))) FAST_FUNC RETURNS_MALLOC;
+char *xasprintf(const char *format, ...) __attribute__ ((format(printf, 1, 2))) RETURNS_MALLOC;
char *auto_string(char *str) FAST_FUNC;
// gcc-4.1.1 still isn't good enough at optimizing it
// (+200 bytes compared to macro)
@@ -1350,12 +1350,12 @@ char* single_argv(char **argv) FAST_FUNC;
char **skip_dash_dash(char **argv) FAST_FUNC;
extern const char *const bb_argv_dash[]; /* { "-", NULL } */
extern uint32_t option_mask32;
-uint32_t getopt32(char **argv, const char *applet_opts, ...) FAST_FUNC;
+uint32_t getopt32(char **argv, const char *applet_opts, ...);
# define No_argument "\0"
# define Required_argument "\001"
# define Optional_argument "\002"
#if ENABLE_LONG_OPTS
-uint32_t getopt32long(char **argv, const char *optstring, const char *longopts, ...) FAST_FUNC;
+uint32_t getopt32long(char **argv, const char *optstring, const char *longopts, ...);
#else
#define getopt32long(argv,optstring,longopts,...) \
getopt32(argv,optstring,##__VA_ARGS__)
@@ -1430,17 +1430,17 @@ extern uint8_t xfunc_error_retval;
extern void (*die_func)(void);
void xfunc_die(void) NORETURN FAST_FUNC;
void bb_show_usage(void) NORETURN FAST_FUNC;
-void bb_error_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))) FAST_FUNC;
+void bb_error_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2)));
void bb_simple_error_msg(const char *s) FAST_FUNC;
-void bb_error_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2))) FAST_FUNC;
+void bb_error_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2)));
void bb_simple_error_msg_and_die(const char *s) NORETURN FAST_FUNC;
-void bb_perror_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))) FAST_FUNC;
+void bb_perror_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2)));
void bb_simple_perror_msg(const char *s) FAST_FUNC;
-void bb_perror_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2))) FAST_FUNC;
+void bb_perror_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2)));
void bb_simple_perror_msg_and_die(const char *s) NORETURN FAST_FUNC;
-void bb_herror_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))) FAST_FUNC;
+void bb_herror_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2)));
void bb_simple_herror_msg(const char *s) FAST_FUNC;
-void bb_herror_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2))) FAST_FUNC;
+void bb_herror_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2)));
void bb_simple_herror_msg_and_die(const char *s) NORETURN FAST_FUNC;
void bb_perror_nomsg_and_die(void) NORETURN FAST_FUNC;
void bb_perror_nomsg(void) FAST_FUNC;
@@ -1456,7 +1456,7 @@ void bb_logenv_override(void) FAST_FUNC;
typedef smalluint exitcode_t;
#if ENABLE_FEATURE_SYSLOG_INFO
-void bb_info_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))) FAST_FUNC;
+void bb_info_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2)));
void bb_simple_info_msg(const char *s) FAST_FUNC;
void bb_vinfo_msg(const char *s, va_list p) FAST_FUNC;
#else
@@ -1832,8 +1832,8 @@ int get_termios_and_make_raw(int fd, struct termios *newterm, struct termios *ol
int set_termios_to_raw(int fd, struct termios *oldterm, int flags) FAST_FUNC;
/* NB: "unsigned request" is crucial! "int request" will break some arches! */
-int ioctl_or_perror(int fd, unsigned request, void *argp, const char *fmt,...) __attribute__ ((format (printf, 4, 5))) FAST_FUNC;
-int ioctl_or_perror_and_die(int fd, unsigned request, void *argp, const char *fmt,...) __attribute__ ((format (printf, 4, 5))) FAST_FUNC;
+int ioctl_or_perror(int fd, unsigned request, void *argp, const char *fmt,...) __attribute__ ((format (printf, 4, 5)));
+int ioctl_or_perror_and_die(int fd, unsigned request, void *argp, const char *fmt,...) __attribute__ ((format (printf, 4, 5)));
#if ENABLE_IOCTL_HEX2STR_ERROR
int bb_ioctl_or_warn(int fd, unsigned request, void *argp, const char *ioctl_name) FAST_FUNC;
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,
return (int32_t)-1;
}
-uint32_t FAST_FUNC
+uint32_t
getopt32(char **argv, const char *applet_opts, ...)
{
uint32_t opt;
@@ -608,7 +608,7 @@ getopt32(char **argv, const char *applet_opts, ...)
}
#if ENABLE_LONG_OPTS
-uint32_t FAST_FUNC
+uint32_t
getopt32long(char **argv, const char *applet_opts, const char *longopts, ...)
{
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 @@
*/
#include "libbb.h"
-void FAST_FUNC bb_herror_msg(const char *s, ...)
+void bb_herror_msg(const char *s, ...)
{
va_list p;
@@ -17,7 +17,7 @@ void FAST_FUNC bb_herror_msg(const char *s, ...)
va_end(p);
}
-void FAST_FUNC bb_herror_msg_and_die(const char *s, ...)
+void bb_herror_msg_and_die(const char *s, ...)
{
va_list p;
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 @@
*/
#include "libbb.h"
-void FAST_FUNC bb_perror_msg(const char *s, ...)
+void bb_perror_msg(const char *s, ...)
{
va_list p;
@@ -18,7 +18,7 @@ void FAST_FUNC bb_perror_msg(const char *s, ...)
va_end(p);
}
-void FAST_FUNC bb_perror_msg_and_die(const char *s, ...)
+void bb_perror_msg_and_die(const char *s, ...)
{
va_list p;
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)
#endif
-void FAST_FUNC bb_error_msg_and_die(const char *s, ...)
+void bb_error_msg_and_die(const char *s, ...)
{
va_list p;
@@ -166,7 +166,7 @@ void FAST_FUNC bb_error_msg_and_die(const char *s, ...)
xfunc_die();
}
-void FAST_FUNC bb_error_msg(const char *s, ...)
+void bb_error_msg(const char *s, ...)
{
va_list p;
@@ -183,7 +183,7 @@ void FAST_FUNC bb_vinfo_msg(const char *s, va_list p)
syslog_level = LOG_ERR;
}
-void FAST_FUNC bb_info_msg(const char *s, ...)
+void bb_info_msg(const char *s, ...)
{
va_list p;
diff --git a/libbb/xfuncs_printf.c b/libbb/xfuncs_printf.c
index 842d10cd2..e7b3fde98 100644
--- a/libbb/xfuncs_printf.c
+++ b/libbb/xfuncs_printf.c
@@ -334,7 +334,7 @@ void FAST_FUNC xprint_and_close_file(FILE *file)
// Die with an error message if we can't malloc() enough space and do an
// sprintf() into that space.
-char* FAST_FUNC xasprintf(const char *format, ...)
+char* xasprintf(const char *format, ...)
{
va_list p;
int r;
@@ -547,7 +547,7 @@ void FAST_FUNC selinux_or_die(void)
/* not defined, other code must have no calls to it */
#endif
-int FAST_FUNC ioctl_or_perror_and_die(int fd, unsigned request, void *argp, const char *fmt,...)
+int ioctl_or_perror_and_die(int fd, unsigned request, void *argp, const char *fmt,...)
{
int ret;
va_list p;
@@ -563,7 +563,7 @@ int FAST_FUNC ioctl_or_perror_and_die(int fd, unsigned request, void *argp, cons
return ret;
}
-int FAST_FUNC ioctl_or_perror(int fd, unsigned request, void *argp, const char *fmt,...)
+int ioctl_or_perror(int fd, unsigned request, void *argp, const char *fmt,...)
{
va_list p;
int ret = ioctl(fd, request, argp);
--
2.43.0
More information about the busybox
mailing list