[tlbuild] build failure: duplicated extern "C" definition of getopt() when compiling a C++ program

Karl Berry karl at freefriends.org
Sun Jun 6 23:36:11 CEST 2010


    i wanted to propose a more "portable" approach of detecting the presence
    of the prototype in unistd.h and defining our own prototype if there's
    no prototype in unistd.h, for the sake of some other systems.

I feel sure that every system we compile on declares getopt() by now.
So I removed the non-__STDC__ decl of getopt from kpathsea/getopt.h.
(If I had it to do over, I would name everything kpse_getopt* and avoid
all this useless pain.)

It still seems wrong to me, in principle, for a compiler to complain
about a declaration like getopt() -- such a traditional C declaration is
supposed to match anything, as far as I know.


More information about the tlbuild mailing list