binutils-gdb/include
Simon Marchi 6cade9185c gdb, include: replace pragmas with DIAGNOSTIC macros, fix build with g++ 4.8
When introducing this code, I forgot that we had some macros for this.
Replace some "manual" pragma diagnostic with some DIAGNOSTIC_* macros,
provided by include/diagnostics.h.

In diagnostics.h:

 - Add DIAGNOSTIC_ERROR, to enable a diagnostic at error level.
 - Add DIAGNOSTIC_ERROR_SWITCH, to enable -Wswitch at error level, for
   both gcc and clang.

Additionally, using DIAGNOSTIC_PUSH, DIAGNOSTIC_ERROR_SWITCH and
DIAGNOSTIC_POP seems to misbehave with g++ 4.8, where we see these
errors:

      CXX    ada-tasks.o
    /home/smarchi/src/binutils-gdb/gdb/ada-tasks.c: In function void read_known_tasks():
    /home/smarchi/src/binutils-gdb/gdb/ada-tasks.c:998:10: error: enumeration value ADA_TASKS_UNKNOWN not handled in switch [-Werror=switch]
       switch (data->known_tasks_kind)
              ^

Because of the POP, the diagnostic should go back to being disabled,
since it was disabled in the beginning, but that's not what we see
here.  Versions of GCC >= 5 compile correctly.

Work around this by making DIAGNOSTIC_ERROR_SWITCH a no-op for GCC < 5.

Note that this code (already as it exists in master today) enables
-Wswitch at the error level even if --disable-werror is passed.  It
shouldn't be a problem, as it's not like a new enumerator will appear
out of nowhere and cause a build error if building with future
compilers.  Still, for correctness, we would ideally want to ask the
compiler to enable -Wswitch at its default level (as if the user had
passed -Wswitch on the command-line).  There doesn't seem to be a way to
do this.

Change-Id: Id33ebec3de39bd449409ea0bab59831289ffe82d
2021-12-02 08:24:25 -05:00
..
aout
cgen Remove bfd_stdint.h 2021-03-31 10:49:23 +10:30
coff Fix the fields in the x_n union inside the the x_file structure so that pointers can be stored. 2021-12-01 11:29:34 +00:00
elf readelf: recognize FDO Packaging Metadata ELF note 2021-12-01 14:44:25 +00:00
gdb sim: create header namespace 2021-05-14 00:41:05 -04:00
mach-o
opcode RISC-V: The vtype immediate with more than the defined 8 bits are preserved. 2021-11-30 19:03:48 +08:00
sim sim: callback: expose argv & environ 2021-11-16 01:13:39 -05:00
som
vms
alloca-conf.h
ansidecl.h
bfdlink.h elf: Add GNU_PROPERTY_1_NEEDED check 2021-07-08 18:14:31 -07:00
binary-io.h
bout.h
ChangeLog Fix the fields in the x_n union inside the the x_file structure so that pointers can be stored. 2021-12-01 11:29:34 +00:00
ChangeLog-0415
ChangeLog-2016
ChangeLog-2017
ChangeLog-2018
ChangeLog-2019
ChangeLog-2020
ChangeLog-9103
COPYING
COPYING3
ctf-api.h libctf, include: support an alternative encoding for nonrepresentable types 2021-05-06 09:30:59 +01:00
ctf.h libctf, include: support an alternative encoding for nonrepresentable types 2021-05-06 09:30:59 +01:00
demangle.h Synchronize libiberty sources (and include/demangle.h) with GCC master version 2021-07-03 14:00:33 +01:00
diagnostics.h gdb, include: replace pragmas with DIAGNOSTIC macros, fix build with g++ 4.8 2021-12-02 08:24:25 -05:00
dis-asm.h opcodes/riscv: add disassembler options support to libopcodes 2021-11-26 10:18:35 +00:00
dwarf2.def
dwarf2.h
dyn-string.h
environ.h
fibheap.h
filenames.h
floatformat.h
fnmatch.h
fopen-bin.h
fopen-same.h
fopen-vms.h
gcc-c-fe.def
gcc-c-interface.h
gcc-cp-fe.def
gcc-cp-interface.h
gcc-interface.h
getopt.h
hashtab.h libiberty: add htab_eq_string 2021-05-07 11:17:11 +01:00
hp-symtab.h
leb128.h
libiberty.h
longlong.h
lto-symtab.h
MAINTAINERS
md5.h
oasys.h
objalloc.h
obstack.h obstack.h __PTR_ALIGN vs. ubsan 2021-09-02 13:48:21 +09:30
os9k.h
partition.h
plugin-api.h
progress.h
safe-ctype.h
sha1.h
simple-object.h
sort.h
splay-tree.h
symcat.h
timeval-utils.h
vtv-change-permission.h
xregex2.h
xregex.h
xtensa-config.h
xtensa-isa-internal.h
xtensa-isa.h