summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorNico Huber <nico.h@gmx.de>2020-04-04 21:00:56 +0200
committerFelix Held <felix-coreboot@felixheld.de>2020-04-04 21:42:43 +0000
commit7c45c8363d86280d70cb671ea713a06fd462a6e7 (patch)
treecbe753d309fc8b555f6906161a408d3b57b81b2c /src/include
parent37f3d7bb706f4ee93e7a378028fc328ebbe08ca8 (diff)
downloadcoreboot-7c45c8363d86280d70cb671ea713a06fd462a6e7.tar.xz
assert.h: Add a tag parameter to dead_code()
When dead_code() is used in inline functions in a header file, the generated function names (based on the line number) may collide with a dead_code() in the code file. Now that we are hit by such a case, we need a quick solution: Add a tag argument for all invocations in header files. Change-Id: I0c548ce998cf8e28ae9f76b5c0ea5630b4e91ae2 Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/40140 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Felix Held <felix-coreboot@felixheld.de> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/assert.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/include/assert.h b/src/include/assert.h
index 990cee11b5..fbaf11a4d6 100644
--- a/src/include/assert.h
+++ b/src/include/assert.h
@@ -65,13 +65,13 @@
* ramstage/lib/bootmode.o: In function `display_init_required':
* bootmode.c:42: undefined reference to `dead_code_assertion_failed_at_line_42'
*/
-#define __dead_code(line) do { \
- extern void dead_code_assertion_failed_at_line_##line(void) \
+#define __dead_code(tag, line) do { \
+ extern void dead_code_assertion_failed##tag##_at_line_##line(void) \
__attribute__((noreturn)); \
- dead_code_assertion_failed_at_line_##line(); \
+ dead_code_assertion_failed##tag##_at_line_##line(); \
} while (0)
-#define _dead_code(line) __dead_code(line)
-#define dead_code() _dead_code(__LINE__)
+#define _dead_code(tag, line) __dead_code(tag, line)
+#define dead_code(tag) _dead_code(tag, __LINE__)
/* This can be used in the context of an expression of type 'type'. */
#define dead_code_t(type) ({ \