[Xorp-hackers] compiler brokes at EtherMac::valid

edrt edrt@citiz.net
Tue, 2 Dec 2003 19:54:5 +0800


>On Tue, 2003-12-02 at 11:20, edrt wrote:
>> >>    When porting mac.cc, my compiler broken at EtherMac::valid. 
>> >> Is "buf[s.size() + 1]" definition valid ? Instead, when replace it with fixed size definition the 
>> >> compiler doesn't complains.
>> >>    Is it someting to do with my compiler? My compiler is g++ppc (gcc driver version 
>> >> cygnus-2.7.2-960126 egcs-971225), below is the output of the compiler :
>> >
>> >The variable-length automatic arrays are GCC-ism.
>> >They are used in few places, because they help to make the code a
>> >bit simpler.
>> >
>> >It looks like your compiler is from the gcc family so I guess it
>> >should be able to compile it, but from the compilation error below
>> >the reason it fails is obvious: "Internal compiler error" (i.e., a
>> >compiler bug).
>> >
>> >Nevertheless, variable-length arrays make the code more difficult to
>> >port (as you have noticed already), hence I think we should try to
>> >get rid of them (especially given that I am probably the most
>> >frequent user of variable-length arrays :)
>> >
>> >In other words, your solution of using fixed-size definition is the
>> >right one.
>> >
>> >Thanks,
>> >Pavlin
>> >
>> >P.S. BTW, what OS are you trying to port XORP to? Please don't tell
>> >me it is Windows :)
>> 
>> The target OS is vxworks running on powerpc, using cross-development tools 
>> running on Windows to build and download it to target board.
>> 
>> Thanks
>> Edrt
>> 
>Sounds interesting, can you say any more about what your long term goals
>are ? Copy your reply to xorp-hackers if this is appropriate.
>
>Adam
>Part-time xorp developer
>Full-time PhD
>
Short term goal is port and play with PIM. Later to port the other Xorp component 
to the embedded platform (especially IPC stuff). 
C++ code is more manageable, greatly reduce the time to understand the Xorp internal : )

Edrt

>> 
>> >
>> >> 
>> >> /* 
>> >>  * ccppc -g -mcpu=860 -ansi -nostdinc -DRW_MULTI_THREAD -D_REENTRANT -fvolatile -fno-builtin	
>> >>  * -fno-for-scope -I. -IC:\Tornado\target\h -DCPU=PPC860 -c E:\NIP\source\libxorp\mac.cc
>> >>  * E:\NIP\source\libxorp\mac.cc: In function `static bool EtherMac::valid(const class basic_s 
>> >>  * tring<char,string_char_traits<char>,__default_alloc_template<true,0> > &)':
>> >>  * E:\NIP\source\libxorp\mac.cc:113: Internal compiler error.
>> >>  * E:\NIP\source\libxorp\mac.cc:113: Please submit a full bug report to `egcs-bugs@cygnus.com 
>> >>  * '.
>> >>  * make: *** [mac.o] Error 0x1
>> >>  */
>> >> 
>> >> 
>> >> Edrt
>> 
>> 			
>> 
>> 
>> 
>> _______________________________________________
>> Xorp-hackers mailing list
>> Xorp-hackers@icir.org
>> http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/xorp-hackers