GDB Master Fails to Build on CentOS 7

Joel Sherrill via Gdb <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <CAF9ehCXzGTwn58jdL=+=fSaB6Z_XMfL_PNa8g8+jWCgLOKt6dw@mail.gmail.com>
Hi

This appears to be due to the older gcc apparently not defaulting to C99.
Either the code needs to change or -std=c99 needs to be passed by the build
machinery.

ibtool: compile:  gcc -O2 -g -pipe
-I/home/joel/rtems-work/rtems-source-builder/rtems/build/tmp/sb-1001/7/rtems-powerpc/home/joel/rtems-work/tools/7/include
-DHAVE_CONFIG_H -I. -I../../sourceware-mirror-binutils-gdb-ed29efb/opcodes
-I. -I../../sourceware-mirror-binutils-gdb-ed29efb/opcodes -I../bfd
-I../../sourceware-mirror-binutils-gdb-ed29efb/opcodes/../include
-I../../sourceware-mirror-binutils-gdb-ed29efb/opcodes/../bfd -W -Wall
-Wstrict-prototypes -Wmissing-prototypes -Wshadow -g -O2 -MT ppc-dis.lo -MD
-MP -MF .deps/ppc-dis.Tpo -c
../../sourceware-mirror-binutils-gdb-ed29efb/opcodes/ppc-dis.c -o ppc-dis.o
../../sourceware-mirror-binutils-gdb-ed29efb/opcodes/ppc-dis.c: In function
‘print_insn_powerpc’:
../../sourceware-mirror-binutils-gdb-ed29efb/opcodes/ppc-dis.c:1071:8:
error: ‘for’ loop initial declarations are only allowed in C99 mode
        for (int i = 0; i < 2; i++)

Thanks.

--joel
RTEMS
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.