This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more infromation.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

arm-linux-g++ error


Hello,

I am cross-compiling c++ source on a x86 for an arm-linux target (iPaq
Bitsy). In general this seems to work well and I can build most things ok.

However, I seem to have come across an anomaly. When including /netinet/in.h
for use with AF_INET sockets, arm-linux-gcc comes up with the c++ error
below stating that ANSI-C++ forbids a field being declared with the same
name as its enclosing class. There is no such problem with the x86 gcc.

The error message is:
/usr/arm-linux/include/bits/in.h:69: ANSI C++ forbids data member `ip_opts'
with same name as enclosing class

The code snippet from /usr/arm-linux/include/bits/in.h is:

struct ip_opts
  {
    struct in_addr ip_dst;      /* First hop; zero without source route.  */
    char ip_opts[40];           /* Actually variable in size.  */
  };

The include file is the same as in the x86 version and placing rubbish
around the declaration flips the x86 compiler out with error messages so the
code actually is being included.

The compiler versions are different in only their minor numbers.
gcc version 2.95.2 20000220 (Debian GNU/Linux)
gcc version 2.95.2 20000313 (Debian GNU/Linux)

The compiler invocations are:
arm-linux-g++  -g -Wall -I- -I. -I/usr/arm-linux/include -I/usr/arm-linux/in
clude/dtk -fsigned-char -c tcltts.cpp -o tcltts.o
and
g++  -g -Wall -I- -I.  -I/usr/include/ -I/usr/include/dtk -fsigned-char -c
tcltts.cpp -o tcltts.o


Any thoughts or fixes out there?

Nick Bane
nick@cecomputing.co.uk


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]