[NTG-pdftex] 1.40.0-beta-20060811

gnwiii at gmail.com gnwiii at gmail.com
Fri Aug 18 17:53:43 CEST 2006

On 8/11/06, Martin Schröder <martin at oneiros.de> wrote:
> http://sarovar.org/download.php/1064/pdftex-1.40.0-beta-20060811.tar.bz2
> http://sarovar.org/download.php/1065/pdftex-1.40.0-beta-20060725-20060811.diff.gz
> ---------------------------------------------------------------
> pdfTeX 3.141592-1.40.0-beta-20060811 was released on 2006-08-11
> [...]
> Please have a look at libs/obsdcompat; it has a bunch of very nice
> (and safe) string functions. And it allows the safe use of the
> __attribute__-feature of gcc.

Until now, pdftex could be built using a c99 compiler.   There seems
to be a bug in
gcc 4.1's strsep under "std-c99".

I was able to build this (using the two patches posted to this thread)
on Fedora Core 5 and also SGI Irix 6.5 (using the SGI MIPSPro "c99"
compiler), but both builds had problems in libs/obsdcompat when using

For FC5, configure failed to detect strsep when using "gcc -std=c99":
$ gcc --version
gcc (GCC) 4.1.1 20060525 (Red Hat 4.1.1-1)

$ ./my-build
gcc -std=c99 -g -O2 -march=i686 -Wall -Wpointer-arith -Wuninitialized
-Wsign-compare -Wno-pointer-sign  -I. -I.. -I -I/..  -DHAVE_CONFIG_H
-c ../../../src/libs/obsdcompat/strsep.c
../../../src/libs/obsdcompat/strsep.c:53: error: expected identifier
or '(' before '__extension__'
../../../src/libs/obsdcompat/strsep.c:53: error: expected identifier
or '(' before ')' token
make[1]: *** [strsep.o] Error 1
make[1]: Leaving directory

Note the "-I<null>" and "-I<null>/..", which didn't seem to bother
gcc, but did bother SGI's

Other people have reported this error with gcc 4.1 and the workaround
is to add -DHAVE_STRSEP to the compiler flags. I got past this by
editing config.h to "#define HAVE_STRSEP 1" and running the last make
step in the build script.  The entry in config.log was:

configure:5077: checking whether strsep is declared
configure:5106: gcc -c -std=c99 -g -O2 -march=i686 -Wall
-Wpointer-arith -Wuninitialized -Wsign-compare -Wno-pointer-sign
conftest.c >&5
conftest.c: In function 'main':
conftest.c:50: error: 'strsep' undeclared (first use in this function)
conftest.c:50: error: (Each undeclared identifier is reported only once
conftest.c:50: error: for each function it appears in.)
conftest.c:50: warning: unused variable 'p'
configure:5112: $? = 1
configure: failed program was:
| /* confdefs.h.  */
| #define PACKAGE_NAME "OpenBSD-Compat"
| #define HAVE_STRING_H 1
| /* end confdefs.h.  */
| #ifdef HAVE_STRING_H
| # include <string.h>
| #endif
| int
| main ()
| {
| #ifndef strsep
|   char *p = (char *) strsep;
| #endif
|   ;
|   return 0;
| }
configure:5136: result: no

For IRIX the build failed at the same point, but for a different
reason -- the "-I<null>" removes /usr/include from the search path, so
the system headers aren't found.  I edited the Makefile to add
srcdir=$(VPATH) and again ran the final make step manually to finish
the build.

George N. White III <aa056 at chebucto.ns.ca>
Head of St. Margarets Bay, Nova Scotia

More information about the ntg-pdftex mailing list