This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


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

Re: Could you help me out?



>2)
>Source code is follwed as below named (e.g. test.cc)
>Compiling command `gcc test.cc` or `g++ test.cc`
>The core is dumped when a.out is running "sum += *(unsigned int*)(ptr + i) ;"
>The runing on Linux/X86 is OK.


Solaris/SPARC (and many other sytems) enforce strict alignment rules.

You're derefencing an int * that is not on a 4 byte boundary.

Casper

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