[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#101579: patch for seg faults in configure on IA-64



Adrian Bunk <bunk@fs.tum.de> writes:

> gcc doesn't fail to link with an "undefined reference" error but instead
> the resulting program segfaults?
> 
> If that's the case I'll reassign the bug to gcc.

You've got it backwards.  The reference isn't undefined.  The functions being
called exist.

The problem is that on ia64, some library functions and/or their arguments
have types different than what the compiler picks as a default type if you
don't bother to provide prototypes in your source code.  At run time, the
conversions that have to happen don't always behave the way the programmer
expected, which can lead to seg faults.

On 32 bit machines, and 64 bit machines that try hard to be like 32 bit 
machines in some ways, you can get away with the sloppy coding practice of 
letting the compiler's default typing take the place of providing prototypes.
It is never a good idea to do so, though.  You should *always* include the
proper header files to pick up the actual definitions of the functions you
are calling from system libraries.

Bdale



Reply to: