pkubowicz / opendetex

Improved version of Detex - tool for extracting plain text from TeX and LaTeX sources
Other
236 stars 34 forks source link

[opendetex-2.8.7] support old compilers (from TeX Live) #65

Closed aminophen closed 4 years ago

aminophen commented 4 years ago

Hi,

We (TeX Live team) incorporated your opendetex-2.8.7, but the build fails on some platforms. Please import the patch patch-01-support-old-compiler. Thanks, -- hironobu

detex.l:735:2: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
detex.l:735:2: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code
Makefile:713: recipe for target 'detex-src/detex.o' failed
pkubowicz commented 4 years ago

How can I reproduce this? I have problems finding compiler options you use in Travis output, it's too much text.

aminophen commented 4 years ago

Travis settings are written here:

https://github.com/TeX-Live/texlive-source/blob/trunk/.travis.yml

aminophen commented 4 years ago

And, the error messages are available in last few lines on Travis:

gcc -DHAVE_CONFIG_H -I. -I../../../texk/detex  -I../../../texk/detex/detex-src -I/texlive/Work/texk -I/texlive/texk -DNO_MALLOC_DECL -DKPATHSEA -Dlint  -Wimplicit -Wreturn-type -Wdeclaration-after-statement -Wno-unknown-pragmas -g -O2 -MT detex-src/detex.o -MD -MP -MF $depbase.Tpo -c -o detex-src/detex.o ../../../texk/detex/detex-src/detex.c &&\
mv -f $depbase.Tpo $depbase.Po
detex.l:113:0: warning: "NO_MALLOC_DECL" redefined
<command-line>:0:0: note: this is the location of the previous definition
detex.l: In function 'IncrLineNo':
detex.l:735:2: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
detex.l:735:2: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code
Makefile:713: recipe for target 'detex-src/detex.o' failed
make[4]: *** [detex-src/detex.o] Error 1
make[4]: Leaving directory '/texlive/Work/texk/detex'
pkubowicz commented 4 years ago

I included the patch in opendetex 2.8.8.