This is the mail archive of the gcc@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]
Other format: [Raw text]

Default values of "struct item *items[MAX_ITEMS]" array?


Hi, I'm trying to compile linux kernel (2.4.25) from ppc405 and have the following problem:
After 

struct item *items[MAX_ITEMS];

each element of items[] is initialized to 0xffffffff and following code 

if (items[item] != NULL) {
  items[item]->field = value;
}

gives kernel oops (as expected - trying to reference memory at address 0xffffffff). 
When I compile and run the same code on host PC - array is initialized with zeros and everything is fine.
GCC versions tried - 3.2.3, 3.3.2, 3.3.3.

The questions is: I am doing something wrong or this is a bug or feature of gcc?

thanks in advance,

--

Andriy Korud


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