OpenCores
no use no use 1/1 no use no use
Compiling gdb on Ubuntu 15.04
by salmansheikh on Aug 18, 2015
salmansheikh
Posts: 10
Joined: Jan 30, 2010
Last seen: May 12, 2023
I got the entire gcc toolchain compiled fine but gdb on Ubuntu 15.04.

Would anyone be able to tell me what this error is about? or point me to the right place to ask?


make[4]: Leaving directory '/home/salman/openrisc/build-gdb/gas/po'
make[4]: Entering directory '/home/salman/openrisc/build-gdb/gas'
gcc -DHAVE_CONFIG_H -I. -I../../or1k-src/gas -I. -I../../or1k-src/gas -I../bfd -I../../or1k-src/gas/config -I../../or1k-src/gas/../include -I../../or1k-src/gas/.. -I../../or1k-src/gas/../bfd -DLOCALEDIR="\"/opt/or1k-elf/share/locale\"" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -O2 -MT subsegs.o -MD -MP -MF .deps/subsegs.Tpo -c -o subsegs.o ../../or1k-src/gas/subsegs.c
In file included from ../../or1k-src/gas/as.h:95:0,
from ../../or1k-src/gas/subsegs.c:25:
../../or1k-src/gas/subsegs.c: In function �subseg_change�:
../bfd/bfd.h:304:75: error: right-hand operand of comma expression has no effect [-Werror=unused-value]
#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE)
^
../../or1k-src/gas/subsegs.c:70:7: note: in expansion of macro �bfd_set_section_userdata�
bfd_set_section_userdata (stdoutput, seg, seginfo);
^
../../or1k-src/gas/subsegs.c: In function �subseg_get�:
../bfd/bfd.h:304:75: error: right-hand operand of comma expression has no effect [-Werror=unused-value]
#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE)
^
../../or1k-src/gas/subsegs.c:172:7: note: in expansion of macro �bfd_set_section_userdata�
bfd_set_section_userdata (stdoutput, secptr, seginfo);
^
cc1: all warnings being treated as errors
Makefile:888: recipe for target 'subsegs.o' failed
make[4]: *** [subsegs.o] Error 1
make[4]: Leaving directory '/home/salman/openrisc/build-gdb/gas'
Makefile:2148: recipe for target 'all-recursive' failed
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory '/home/salman/openrisc/build-gdb/gas'
Makefile:680: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/home/salman/openrisc/build-gdb/gas'
Makefile:5043: recipe for target 'all-gas' failed
make[1]: *** [all-gas] Error 2
make[1]: Leaving directory '/home/salman/openrisc/build-gdb'
Makefile:829: recipe for target 'all' failed
RE: Compiling gdb on Ubuntu 15.04
by dgisselq on Aug 18, 2015
dgisselq
Posts: 247
Joined: Feb 20, 2015
Last seen: Oct 24, 2024
Looks like someone tried to change a function into a macro. Looking at binutils 2.25, in bfd/bfd.h, bfd_set_section_userdata is defined as an inline function:

static inline bfd_boolean
bfd_set_section_userdata(bfd *abfd ATTRIBUTE_UNUSED, asection *ptr, void *val)
{
ptr->userdata = val;
return TRUE;
}

Were I to call this as a function, I might ignore the return value. As a macro, returning an ignored value doesn't seem to make much sense, hence the compiler's warning.

Dan
no use no use 1/1 no use no use
© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.