[tlbuild] r33763 appears to stop mendex compilation with gcc on OS X
Richard M Kreuter
kreuter at progn.net
Thu May 1 12:15:55 CEST 2014
Hello,
As of r33767, compilation fails at texk/mendex/fwrite.c using gcc 4.2 on
OS X 10.8.5. (Compilation error below [*].) The last full build I've
performed on this host was at r33688.
The offending lines in the compilation error are all and only the lines
from texk/mendex/fwrite.c that call snprintf with TAIL_LEN as a first
argument; other snprintf calls in the same file (e.g., at line 126)
aren't a problem. (Prior to r33763 these used sprintf.)
Googling for the symptom turned up this report:
http://lists.gnu.org/archive/html/gnutls-devel/2011-01/msg00004.html
In both cases, the offending code an snprintf call where the first
argument is a macro that expands to two arguments in the macro's caller;
and this mixes up gcc's object size checking on OS X.
And indeed, inserting an "#undef snprintf" in texk/mendex/fwrite.c
suffices to compile mendex on this host. (But I consider that only a
confirmation of diagnosis, not a suggested fix.)
Please let me know if more information is required for this problem
report.
Thanks,
Richard
[*] Environment stuff:
$ uname -a
Darwin m5.localdomain 12.5.0 Darwin Kernel Version 12.5.0: Sun Sep 29 13:33:47 PDT 2013; root:xnu-2050.48.12~1/RELEASE_X86_64 x86_64
$ gcc --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Build script invocation:
./Build --with-xdvi-x-toolkit=motif
The compilation errors are as follows:
--
gcc -DHAVE_CONFIG_H -I. -I../../../texk/mendexk -I/Users/kreuter/prs/src/texlive/Work/texk/ptexenc -I/Users/kreuter/prs/src/texlive/texk/ptexenc -I/Users/kreuter/prs/src/texlive/Work/texk -I/Users/kreuter/prs/src/texlive/texk -Wimplicit -Wreturn-type -Wdeclaration-after-statement -Wno-unknown-pragmas -g -O2 -MT fwrite.o -MD -MP -MF $depbase.Tpo -c -o fwrite.o ../../../texk/mendexk/fwrite.c &&\
mv -f $depbase.Tpo $depbase.Po
../../../texk/mendexk/fwrite.c:135:42: error: macro "__darwin_obsz" passed 2 arguments, but takes just 1
../../../texk/mendexk/fwrite.c: In function ‘indwrite’:
../../../texk/mendexk/fwrite.c:135: error: ‘__darwin_obsz’ undeclared (first use in this function)
../../../texk/mendexk/fwrite.c:135: error: (Each undeclared identifier is reported only once
../../../texk/mendexk/fwrite.c:135: error: for each function it appears in.)
../../../texk/mendexk/fwrite.c:135: warning: passing argument 3 of ‘__builtin___snprintf_chk’ makes integer from pointer without a cast
../../../texk/mendexk/fwrite.c:139:58: error: macro "__darwin_obsz" passed 2 arguments, but takes just 1
../../../texk/mendexk/fwrite.c:139: warning: passing argument 3 of ‘__builtin___snprintf_chk’ makes integer from pointer without a cast
../../../texk/mendexk/fwrite.c:140:42: error: macro "__darwin_obsz" passed 2 arguments, but takes just 1
../../../texk/mendexk/fwrite.c:140: warning: passing argument 3 of ‘__builtin___snprintf_chk’ makes integer from pointer without a cast
../../../texk/mendexk/fwrite.c:144:58: error: macro "__darwin_obsz" passed 2 arguments, but takes just 1
../../../texk/mendexk/fwrite.c:144: warning: passing argument 3 of ‘__builtin___snprintf_chk’ makes integer from pointer without a cast
../../../texk/mendexk/fwrite.c:145:58: error: macro "__darwin_obsz" passed 2 arguments, but takes just 1
../../../texk/mendexk/fwrite.c:145: warning: passing argument 3 of ‘__builtin___snprintf_chk’ makes integer from pointer without a cast
../../../texk/mendexk/fwrite.c:146:42: error: macro "__darwin_obsz" passed 2 arguments, but takes just 1
../../../texk/mendexk/fwrite.c:146: warning: passing argument 3 of ‘__builtin___snprintf_chk’ makes integer from pointer without a cast
../../../texk/mendexk/fwrite.c:202:67: error: macro "__darwin_obsz" passed 2 arguments, but takes just 1
../../../texk/mendexk/fwrite.c:202: warning: passing argument 3 of ‘__builtin___snprintf_chk’ makes integer from pointer without a cast
../../../texk/mendexk/fwrite.c:207:68: error: macro "__darwin_obsz" passed 2 arguments, but takes just 1
../../../texk/mendexk/fwrite.c:207: warning: passing argument 3 of ‘__builtin___snprintf_chk’ makes integer from pointer without a cast
../../../texk/mendexk/fwrite.c:211:44: error: macro "__darwin_obsz" passed 2 arguments, but takes just 1
../../../texk/mendexk/fwrite.c:211: warning: passing argument 3 of ‘__builtin___snprintf_chk’ makes integer from pointer without a cast
../../../texk/mendexk/fwrite.c:214:43: error: macro "__darwin_obsz" passed 2 arguments, but takes just 1
../../../texk/mendexk/fwrite.c:214: warning: passing argument 3 of ‘__builtin___snprintf_chk’ makes integer from pointer without a cast
../../../texk/mendexk/fwrite.c:217:48: error: macro "__darwin_obsz" passed 2 arguments, but takes just 1
../../../texk/mendexk/fwrite.c:217: warning: passing argument 3 of ‘__builtin___snprintf_chk’ makes integer from pointer without a cast
../../../texk/mendexk/fwrite.c:218:42: error: macro "__darwin_obsz" passed 2 arguments, but takes just 1
../../../texk/mendexk/fwrite.c:218: warning: passing argument 3 of ‘__builtin___snprintf_chk’ makes integer from pointer without a cast
../../../texk/mendexk/fwrite.c:223:58: error: macro "__darwin_obsz" passed 2 arguments, but takes just 1
../../../texk/mendexk/fwrite.c:223: warning: passing argument 3 of ‘__builtin___snprintf_chk’ makes integer from pointer without a cast
../../../texk/mendexk/fwrite.c:224:69: error: macro "__darwin_obsz" passed 2 arguments, but takes just 1
../../../texk/mendexk/fwrite.c:224: warning: passing argument 3 of ‘__builtin___snprintf_chk’ makes integer from pointer without a cast
../../../texk/mendexk/fwrite.c:227:69: error: macro "__darwin_obsz" passed 2 arguments, but takes just 1
../../../texk/mendexk/fwrite.c:227: warning: passing argument 3 of ‘__builtin___snprintf_chk’ makes integer from pointer without a cast
../../../texk/mendexk/fwrite.c:230:91: error: macro "__darwin_obsz" passed 2 arguments, but takes just 1
../../../texk/mendexk/fwrite.c:230: warning: passing argument 3 of ‘__builtin___snprintf_chk’ makes integer from pointer without a cast
../../../texk/mendexk/fwrite.c:231:73: error: macro "__darwin_obsz" passed 2 arguments, but takes just 1
../../../texk/mendexk/fwrite.c:231: warning: passing argument 3 of ‘__builtin___snprintf_chk’ makes integer from pointer without a cast
../../../texk/mendexk/fwrite.c:234:42: error: macro "__darwin_obsz" passed 2 arguments, but takes just 1
../../../texk/mendexk/fwrite.c:234: warning: passing argument 3 of ‘__builtin___snprintf_chk’ makes integer from pointer without a cast
../../../texk/mendexk/fwrite.c:236:58: error: macro "__darwin_obsz" passed 2 arguments, but takes just 1
../../../texk/mendexk/fwrite.c:236: warning: passing argument 3 of ‘__builtin___snprintf_chk’ makes integer from pointer without a cast
../../../texk/mendexk/fwrite.c:276:64: error: macro "__darwin_obsz" passed 2 arguments, but takes just 1
../../../texk/mendexk/fwrite.c: In function ‘printpage’:
../../../texk/mendexk/fwrite.c:276: error: ‘__darwin_obsz’ undeclared (first use in this function)
../../../texk/mendexk/fwrite.c:276: warning: passing argument 3 of ‘__builtin___snprintf_chk’ makes integer from pointer without a cast
../../../texk/mendexk/fwrite.c:279:64: error: macro "__darwin_obsz" passed 2 arguments, but takes just 1
../../../texk/mendexk/fwrite.c:279: warning: passing argument 3 of ‘__builtin___snprintf_chk’ makes integer from pointer without a cast
../../../texk/mendexk/fwrite.c:282:64: error: macro "__darwin_obsz" passed 2 arguments, but takes just 1
../../../texk/mendexk/fwrite.c:282: warning: passing argument 3 of ‘__builtin___snprintf_chk’ makes integer from pointer without a cast
../../../texk/mendexk/fwrite.c:285:62: error: macro "__darwin_obsz" passed 2 arguments, but takes just 1
../../../texk/mendexk/fwrite.c:285: warning: passing argument 3 of ‘__builtin___snprintf_chk’ makes integer from pointer without a cast
../../../texk/mendexk/fwrite.c:286:53: error: macro "__darwin_obsz" passed 2 arguments, but takes just 1
../../../texk/mendexk/fwrite.c:286: warning: passing argument 3 of ‘__builtin___snprintf_chk’ makes integer from pointer without a cast
../../../texk/mendexk/fwrite.c:288:40: error: macro "__darwin_obsz" passed 2 arguments, but takes just 1
../../../texk/mendexk/fwrite.c:288: warning: passing argument 3 of ‘__builtin___snprintf_chk’ makes integer from pointer without a cast
../../../texk/mendexk/fwrite.c:291:49: error: macro "__darwin_obsz" passed 2 arguments, but takes just 1
../../../texk/mendexk/fwrite.c:291: warning: passing argument 3 of ‘__builtin___snprintf_chk’ makes integer from pointer without a cast
../../../texk/mendexk/fwrite.c:299:44: error: macro "__darwin_obsz" passed 2 arguments, but takes just 1
../../../texk/mendexk/fwrite.c:299: warning: passing argument 3 of ‘__builtin___snprintf_chk’ makes integer from pointer without a cast
../../../texk/mendexk/fwrite.c:307:84: error: macro "__darwin_obsz" passed 2 arguments, but takes just 1
../../../texk/mendexk/fwrite.c:307: warning: passing argument 3 of ‘__builtin___snprintf_chk’ makes integer from pointer without a cast
../../../texk/mendexk/fwrite.c:312:83: error: macro "__darwin_obsz" passed 2 arguments, but takes just 1
../../../texk/mendexk/fwrite.c:312: warning: passing argument 3 of ‘__builtin___snprintf_chk’ makes integer from pointer without a cast
../../../texk/mendexk/fwrite.c:313:80: error: macro "__darwin_obsz" passed 2 arguments, but takes just 1
../../../texk/mendexk/fwrite.c:313: warning: passing argument 3 of ‘__builtin___snprintf_chk’ makes integer from pointer without a cast
../../../texk/mendexk/fwrite.c:317:65: error: macro "__darwin_obsz" passed 2 arguments, but takes just 1
../../../texk/mendexk/fwrite.c:317: warning: passing argument 3 of ‘__builtin___snprintf_chk’ makes integer from pointer without a cast
../../../texk/mendexk/fwrite.c:323:64: error: macro "__darwin_obsz" passed 2 arguments, but takes just 1
../../../texk/mendexk/fwrite.c:323: warning: passing argument 3 of ‘__builtin___snprintf_chk’ makes integer from pointer without a cast
../../../texk/mendexk/fwrite.c:330:82: error: macro "__darwin_obsz"printf_chk’ makes integer from pointer without a cast
../../../texk/mendexk/fwrite.c:386:77: error: macro "__darwin_obsz" passed 2 arguments, but takes just 1
../../../texk/mendexk/fwrite.c:386: warning: passing argument 3 of ‘__builtin___snprintf_chk’ makes integer from pointer without a cast
../../../texk/mendexk/fwrite.c:393:75: error: macro "__darwin_obsz" passed 2 arguments, but takes just 1
../../../texk/mendexk/fwrite.c:393: warning: passing argument 3 of ‘__builtin___snprintf_chk’ makes integer from pointer without a cast
../../../texk/mendexk/fwrite.c:425:57: error: macro "__darwin_obsz" passed 2 arguments, but takes just 1
../../../texk/mendexk/fwrite.c: In function ‘linecheck’:
../../../texk/mendexk/fwrite.c:425: error: ‘__darwin_obsz’ undeclared (first use in this function)
../../../texk/mendexk/fwrite.c:425: warning: passing argument 3 of ‘__builtin___snprintf_chk’ makes integer from pointer without a cast
../../../texk/mendexk/fwrite.c:430:40: error: macro "__darwin_obsz" passed 2 arguments, but takes just 1
../../../texk/mendexk/fwrite.c:430: warning: passing argument 3 of ‘__builtin___snprintf_chk’ makes integer from pointer without a cast
--
More information about the tlbuild
mailing list