diff options
author | Stefan Reinauer <reinauer@chromium.org> | 2012-06-21 17:21:08 -0700 |
---|---|---|
committer | Peter Stuge <peter@stuge.se> | 2012-06-22 03:29:21 +0200 |
commit | 57cd1dd29679918afa650c2a7e82a474765f357d (patch) | |
tree | 09f659228373368a067d9a4383c8b7a86f8dde7b | |
parent | 274c63e367aacbd50fb35f25da896fead08a6c3d (diff) | |
download | coreboot-57cd1dd29679918afa650c2a7e82a474765f357d.tar.xz |
Teach romcc about attribute((unused))
This makes it easier to use the same code on romcc and gcc.
Specifying attribute((unused)) on romcc does nothing.
Change-Id: If9a6900cad12900e499c4b8c91586511eb801987
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/1132
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Tested-by: build bot (Jenkins)
Reviewed-by: Peter Stuge <peter@stuge.se>
-rw-r--r-- | util/romcc/romcc.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/util/romcc/romcc.c b/util/romcc/romcc.c index 1a939fb807..b0f6198e5a 100644 --- a/util/romcc/romcc.c +++ b/util/romcc/romcc.c @@ -1084,6 +1084,7 @@ struct compile_state { struct hash_entry *i_default; struct hash_entry *i_return; struct hash_entry *i_noreturn; + struct hash_entry *i_unused; /* Additional hash entries for predefined macros */ struct hash_entry *i_defined; struct hash_entry *i___VA_ARGS__; @@ -12752,6 +12753,9 @@ static unsigned int attrib(struct compile_state *state, unsigned int attributes) else if (ident == state->i_noreturn) { // attribute((noreturn)) does nothing (yet?) } + else if (ident == state->i_unused) { + // attribute((unused)) does nothing (yet?) + } else { error(state, 0, "Unknown attribute:%s", ident->name); } @@ -24988,6 +24992,7 @@ static void compile(const char *filename, state.i_noinline = lookup(&state, "noinline", 8); state.i_always_inline = lookup(&state, "always_inline", 13); state.i_noreturn = lookup(&state, "noreturn", 8); + state.i_unused = lookup(&state, "unused", 8); /* Process the command line macros */ process_cmdline_macros(&state); |