The buildroot gcc version is 3.4.2, not 3.3.3 -- so I would guess that something in the C++ spec changed (or the gcc implementation of the spec changed) between 3.3.3 and 3.4.2 -- as for signed/unsigned char -- if you're ever making an assumption about the signedness of any C/C++ data type, you *must* specify the signedness, otherwise the compiler implementation is free to set it which ever way it wants (iirc).  Similarly, watch out for x86-based assumptions about things like struct-packing, eg:

typedef struct {
    char foo;
    int baz;
    void * bar;
) my_struct;

sizeof(my_struct) is not necessarily == sizeof(foo)+sizeof(baz)+sizeof(bar) -- in fact on pretty much anything but x86, the size is different.

This is kind of like not assuming that "int" is 32 bits, or that "char" is 8 bits, etc.


On Jul 21, 2005, at 12:33 PM, Cyril Bazin wrote:


We had the same kind of error when we tryed to cross-compile our program
We resolved the error adding "this->" each time the compilator failed.

But, I made a reply to warn you about another thing!
Be careful of the type "char". We spend time to find that the crosscompiler consider the char as unsigned by default on ARM.
(The gcc i386 compiler consider the char as signed).

If you use chars in your program, you can:
- modify your code to replace the "char" by "signed char";
- typedef a type like "s_char" and replace the "char" by "s_char";
- the quickest solution (the one we choosed) is to add the flag "-fsigned-char" to "arm-linux-gcc".

Now, it's working on the ARM like on the i386!


On 7/21/05, Athanasios Anastasiou <> wrote:
Hello All

I am trying to port a program from i386 to arm for gumstix. In my make
file i have a CC variable which i turn to g++ for my development machine
and arm-linux-g++ for the gumstix. (The make file is rather simple.)

When i set the variable to g++ (The native compiler gcc 3.3.3)  it
compiles without any warnings or errors in my labs machine which has
Suse 9.1.

However when i set it to arm-linux-g++ i get specific errors which i
suspect are due to the default configuration (or rather default
assumptions) of g++.
For example, if i have a member variable which i assign to a value in a
member function of a class i have to add the this-> operator infront of
it or else it does not recognise it as the member variable of the class
(Which is a bit strange because the native g++ has no problem with this).

This is enhanced by another fact. The exact same errors appear when i
try to compile my program in a Fedora C4 system (for the i386 case).

How can i find the default arguments- if any-  that are passed to the
compiler that is in the gumstix-buildroot?

All the best.

SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast.
gumstix-users mailing list