Building gdb-7.2 on Solaris 2.6 with CC="cc" I get these two compilation errors: source='dwarf2loc.c' object='dwarf2loc.o' libtool=no DEPDIR=.deps depmode=dashXmstdout /bin/ksh ./../depcomp cc -O -I. -I. -I./common -I./config -DLOCALEDIR="\"/home/haible/prefix-solaris6-sparc/share/locale\"" -DHAVE_CONFIG_H -I./../include/opcode -I./../opcodes/.. -I./../readline/.. -I../bfd -I./../bfd -I./../include -I../libdecnumber -I./../libdecnumber -I./../intl -I./gnulib -Ignulib -DMI_OUT=1 -DTUI=1 -O -c -o dwarf2loc.o dwarf2loc.c "dwarf2loc.c", line 263: void function cannot return value "dwarf2loc.c", line 1073: void function cannot return value ... cc: acomp failed for dwarf2loc.c gmake[2]: *** [dwarf2loc.o] Error 2 The fix is to remove the "return" keyword from dwarf2loc.c:263 and dwarf2loc.c:1073. GCC is the only compiler that supports 'return' of void values.
CVSROOT: /cvs/src Module name: src Branch: gdb_7_2-branch Changes by: tromey@sourceware.org 2011-03-14 15:54:16 Modified files: gdb : ChangeLog dwarf2loc.c Log message: PR gdb/12576: * dwarf2loc.c (dwarf_expr_dwarf_call): Remove 'return'. (needs_frame_dwarf_call): Likewise. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&only_with_tag=gdb_7_2-branch&r1=1.11973.2.70&r2=1.11973.2.71 http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/dwarf2loc.c.diff?cvsroot=src&only_with_tag=gdb_7_2-branch&r1=1.93.2.3&r2=1.93.2.4
CVSROOT: /cvs/src Module name: src Changes by: tromey@sourceware.org 2011-03-14 15:58:56 Modified files: gdb : ChangeLog dwarf2loc.c Log message: PR gdb/12576: * dwarf2loc.c (dwarf_expr_dwarf_call): Remove 'return'. (needs_frame_dwarf_call): Likewise. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.12801&r2=1.12802 http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/dwarf2loc.c.diff?cvsroot=src&r1=1.111&r2=1.112
I checked in the fix to the trunk and the 7.2 branch. -Wreturn-type (implied by -Wall) should have caught this, so I think there is also a GCC bug here.
*** Bug 12904 has been marked as a duplicate of this bug. ***