@@ -190,7 +190,7 @@ static struct function *current_func = NULL;
static struct textbuf *unit_post_text = NULL;
static const char *current_section;
-static void emit_comment(const char * fmt, ...) FORMAT_ATTR(1);
+static void emit_comment(const char * fmt, ...) PRINTF(1);
static void emit_move(struct storage *src, struct storage *dest,
struct symbol *ctype, const char *comment);
static struct storage *x86_address_gen(struct expression *expr);
@@ -226,7 +226,7 @@ static struct storage_hash *find_or_create_hash(pseudo_t pseudo, struct storage_
}
/* Eventually we should just build it up in memory */
-static void FORMAT_ATTR(2) output_line(struct bb_state *state, const char *fmt, ...)
+static void PRINTF(2) output_line(struct bb_state *state, const char *fmt, ...)
{
va_list args;
@@ -235,7 +235,7 @@ static void FORMAT_ATTR(2) output_line(struct bb_state *state, const char *fmt,
va_end(args);
}
-static void FORMAT_ATTR(2) output_label(struct bb_state *state, const char *fmt, ...)
+static void PRINTF(2) output_label(struct bb_state *state, const char *fmt, ...)
{
static char buffer[512];
va_list args;
@@ -247,7 +247,7 @@ static void FORMAT_ATTR(2) output_label(struct bb_state *state, const char *fmt,
output_line(state, "%s:\n", buffer);
}
-static void FORMAT_ATTR(2) output_insn(struct bb_state *state, const char *fmt, ...)
+static void PRINTF(2) output_insn(struct bb_state *state, const char *fmt, ...)
{
static char buffer[512];
va_list args;
@@ -262,7 +262,7 @@ static void FORMAT_ATTR(2) output_insn(struct bb_state *state, const char *fmt,
#define output_insn(state, fmt, arg...) \
output_insn(state, fmt "\t\t# %s" , ## arg , __FUNCTION__)
-static void FORMAT_ATTR(2) output_comment(struct bb_state *state, const char *fmt, ...)
+static void PRINTF(2) output_comment(struct bb_state *state, const char *fmt, ...)
{
static char buffer[512];
va_list args;
@@ -217,8 +217,7 @@ void expression_error(struct expression *expr, const char *fmt, ...)
expr->ctype = &bad_ctype;
}
-NORETURN_ATTR
-void error_die(struct position pos, const char * fmt, ...)
+void NORETURN error_die(struct position pos, const char * fmt, ...)
{
va_list args;
va_start(args, fmt);
@@ -227,8 +226,7 @@ void error_die(struct position pos, const char * fmt, ...)
exit(1);
}
-NORETURN_ATTR
-void die(const char *fmt, ...)
+void NORETURN die(const char *fmt, ...)
{
va_list args;
static char buffer[512];
@@ -89,25 +89,21 @@ struct token *expect(struct token *, int, const char *);
void unexpected(struct token *, const char *errmsg);
#ifdef __GNUC__
-#define FORMAT_ATTR(pos) __attribute__ ((__format__ (__printf__, pos, pos+1)))
-#define NORETURN_ATTR __attribute__ ((__noreturn__))
-#define SENTINEL_ATTR __attribute__ ((__sentinel__))
+#define PRINTF(pos) __attribute__((__format__(__printf__, pos, pos+1)))
+#define NORETURN __attribute__((__noreturn__))
+#define SENTINEL __attribute__((__sentinel__))
#else
-#define FORMAT_ATTR(pos)
-#define NORETURN_ATTR
-#define SENTINEL_ATTR
+#define PRINTF(pos)
+#define NORETURN
+#define SENTINEL
#endif
-FORMAT_ATTR(1) NORETURN_ATTR
-extern void die(const char *, ...);
-
-FORMAT_ATTR(2) NORETURN_ATTR
-extern void error_die(struct position, const char *, ...);
-
-extern void info(struct position, const char *, ...) FORMAT_ATTR(2);
-extern void warning(struct position, const char *, ...) FORMAT_ATTR(2);
-extern void sparse_error(struct position, const char *, ...) FORMAT_ATTR(2);
-extern void expression_error(struct expression *, const char *, ...) FORMAT_ATTR(2);
+extern void NORETURN die(const char *, ...) PRINTF(1);
+extern void NORETURN error_die(struct position, const char *, ...) PRINTF(2);
+extern void info(struct position, const char *, ...) PRINTF(2);
+extern void warning(struct position, const char *, ...) PRINTF(2);
+extern void sparse_error(struct position, const char *, ...) PRINTF(2);
+extern void expression_error(struct expression *, const char *, ...) PRINTF(2);
#define ERROR_CURR_PHASE (1 << 0)
#define ERROR_PREV_PHASE (1 << 1)
@@ -129,7 +125,7 @@ enum phase {
#define PASS_FINAL (1UL << PASS__FINAL)
-extern void add_pre_buffer(const char *fmt, ...) FORMAT_ATTR(1);
+extern void add_pre_buffer(const char *fmt, ...) PRINTF(1);
extern int preprocess_only;
@@ -604,7 +604,7 @@ static void fn_local_symbol(struct symbol *sym)
add_symbol(function_symbol_list, sym);
}
-static int SENTINEL_ATTR match_idents(struct token *token, ...)
+static int SENTINEL match_idents(struct token *token, ...)
{
va_list args;
struct ident * next;
@@ -187,7 +187,7 @@ struct type_name {
char *end;
};
-static void FORMAT_ATTR(2) prepend(struct type_name *name, const char *fmt, ...)
+static void PRINTF(2) prepend(struct type_name *name, const char *fmt, ...)
{
static char buffer[512];
int n;
@@ -201,7 +201,7 @@ static void FORMAT_ATTR(2) prepend(struct type_name *name, const char *fmt, ...)
memcpy(name->start, buffer, n);
}
-static void FORMAT_ATTR(2) append(struct type_name *name, const char *fmt, ...)
+static void PRINTF(2) append(struct type_name *name, const char *fmt, ...)
{
static char buffer[512];
int n;
likewise for NORETURN_ATTR & SENTINEL_ATTR going to the simpler NORETURN & SENTINEL. The goal is to win a bit of screen real estate. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com> --- Here is the result, just to show, but I don't find it interesting enough to add it to the tree. compile-i386.c | 2 +- example.c | 8 ++++---- lib.c | 6 ++---- lib.h | 30 +++++++++++++----------------- parse.c | 2 +- show-parse.c | 4 ++-- 6 files changed, 23 insertions(+), 29 deletions(-)