Skip to content

Commit

Permalink
Fix compilation on GCC 4.x
Browse files Browse the repository at this point in the history
TeX Live supports compiling on GCC 4.5, which does not enable
C99 features (introduced in 2a2057b) when run with default settings.

This commit returns to pre-C99 syntax and adds instructions how to simulate
an old compiler locally.

Closes #65
  • Loading branch information
pkubowicz committed Jun 17, 2020
1 parent ddcdedd commit 8ad0c35
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -204,3 +204,5 @@ Handle forcing placement with ! (#62). Thanks to schrc3b6.
Added option to print source information with -1 (#64). Thanks to Victor Cacciari Miraldo.

(Version 2.8.8) -- UNRELEASED

Fixed compilation on old compilers supported by TeX Live (#65). Thanks to Akira Kakuto and Hironobu Yamashita.
5 changes: 5 additions & 0 deletions README-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ It is recommended that you install Valgrind and run tests using it (as it is don
./test.pl --valgrind
```

Also recommended: check if compilation is not broken on oldest compilers supported by Tex Live (again, if you don't do this, it will be checked on CI):
```
make clean all DEFS='-std=iso9899:199409'
```

After pushing check cross-platform compilation results on commits list on GitHub or directly on [Travis CI](https://travis-ci.org/pkubowicz/opendetex).

## Releasing a new version
Expand Down
3 changes: 2 additions & 1 deletion detex.l
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,8 @@ Echo()
void
IncrLineNo()
{
for (char* c=yytext; *c != '\0'; c++) {
char *c;
for (c=yytext; *c != '\0'; c++) {
if (*c == '\n') {
fFileLines[csb]++; fIsColumn0=1;
}
Expand Down

0 comments on commit 8ad0c35

Please sign in to comment.