[tex-live] Bug#667392: Parts of TeX Live do not compile using gcc 4.7

Karl Berry karl at freefriends.org
Sun Apr 8 23:35:25 CEST 2012

Hi again Julian,

    I wonder which library the getopt(_long) calls are
    taken from - is it from the kpse library or the libc++ library?  If
    the prototypes are different, are the behaviours different as well?
    If so, might it be wiser to rename the functions so that the behaviour
    is consistent across platforms?

Given the number of people who have touched this code since I originally
adapted it for kpse, I no longer know exactly what happens without
intensive investigation; it's not easy to tell from the maze of #ifdef's
in getopt.h.  Anyway, I doubt the system vs. kpse getopt behavior is
different in any way that matters to us.

I originally included getopt (and a lot of other things) in kpathsea
precisely so that the TeX programs could have the same behavior across
platforms and not have to repeat all this system-dependent ugliness in
multiple places.  When getopt(_long) was in libc, it was used from
there.  Otherwise, it was pulled in from kpathsea.  

These days, what with the plethora of distros doing crazy things, new
versions with incompatible definitions, compiling C code under C++,
etc., etc., there are a corresponding plethora of new and useless

We can do something to cut the Gordian knot, since clearly it is a pain
to keep having to adjust with the never-ending new system
"improvements", but like I said in my last mail: it requires
investigating/changing all uses of getopt(_long) everywhere in the
source.  It would make sense in the long term, but don't want to go
there now, just for the sake of a trivial mismatch under a brand-new
compiler version that we don't even want to use for TL'12.  What's
simple is to omit the declaration when compiling under C++, since that
is where the problem occurs.

I have just tested that omission of the declaration, since no one else
was jumping at doing the work, and it did compile everything fine under
4.7.0.  Now I'm running a compile under an old version to see how that
goes.  I'll commit something when I have some actual evidence.


More information about the tex-live mailing list