K
Keith Vetter
Hi,
After a long debugging session I tracked down a
bug to the following line of code:
np = &nl[alloc_memory()]; /* nl & np are NODE * */
The problem is that nl is volatile--alloc_memory() may
change it (via realloc). The AIX compiler fails--it grabs
the value of nl before the call to alloc_memory(). The
Windows VC 6.0 compiler handles it correctly.
So is this a compiler bug, programmer error or ambiguous c?
Thanks,
Keith
After a long debugging session I tracked down a
bug to the following line of code:
np = &nl[alloc_memory()]; /* nl & np are NODE * */
The problem is that nl is volatile--alloc_memory() may
change it (via realloc). The AIX compiler fails--it grabs
the value of nl before the call to alloc_memory(). The
Windows VC 6.0 compiler handles it correctly.
So is this a compiler bug, programmer error or ambiguous c?
Thanks,
Keith