From 555e15ebe8bf1eb33d00747173cfc80cc65648a4 Mon Sep 17 00:00:00 2001 From: Joshua Watt Date: Fri, 9 Feb 2018 10:27:18 -0600 Subject: Use fallthrough attribute. Use __attribute__ ((fallthrough)) to indicate switch case fall through instead of a comment. This ensures that the fallthrough warning is not triggered even if the file is pre-processed (hence stripping the comments) before it is compiled. The actual fallback implementation is hidden behind a FALLBACK macro in case the compiler doesn't support it. Finally, the -Wimplict-fallthrough warning was upgraded to only allow the attribute to satisfy it; a comment alone is no longer sufficient. Signed-off-by: Joshua Watt --- libdwfl/dwfl_report_elf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libdwfl/dwfl_report_elf.c') diff --git a/libdwfl/dwfl_report_elf.c b/libdwfl/dwfl_report_elf.c index 6950a37b..3fc9384a 100644 --- a/libdwfl/dwfl_report_elf.c +++ b/libdwfl/dwfl_report_elf.c @@ -174,7 +174,7 @@ __libdwfl_elf_address_range (Elf *elf, GElf_Addr base, bool add_p_vaddr, /* An assigned base address is meaningless for these. */ base = 0; add_p_vaddr = true; - /* Fallthrough. */ + FALLTHROUGH; case ET_DYN: default:; size_t phnum; -- cgit v1.2.3