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

Bug#101579: Problem compiling teTeX on IA-64



Hi,

Bdale Garbee <bdale@gag.com> reported the following problem with
the 20001218 beta of teTeX:

<--  snip  ->

The configure script in the texk/kpathsea directory seg faults when running
the test program that checks whether putenv uses malloc.  The problem is that
the test program doesn't include enough headers, and implicit declarations on
IA-64 almost always don't do what you want.

The fix is easy, that test program needs to

        #include <stdlib.h>
        #include <string.h>

so that there aren't any implicitly declared library functions.  The package
builds cleanly once this change is made.
...
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.

<--  snip  -->

cu
Adrian

-- 

Get my GPG key: finger bunk@debian.org | gpg --import

Fingerprint: B29C E71E FE19 6755 5C8A  84D4 99FC EA98 4F12 B400





Reply to: