Not sure if we still care about C89 in general, but MSVC requires this style
too.
Details
Details
- Reviewers
marmoute - Group Reviewers
hg-reviewers - Commits
- rHG3122058df7a5: cext: move variable declaration to the top of the block for C89 support
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
Comment Actions
I don't think so. You need CFLAGS=-std=c89 (and maybe -pedantic). But in C89 mode with gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0, it fails to build complaining about C++ comments and not understanding inline, and also issues a bunch of warnings about various things.
Comment Actions
Could we enable some kind of warning to catch this in the tests ?
-Wdeclaration-after-statement for gcc and maybe clang.
Comment Actions
I can confirm that this works on 18.04, though it doesn't issue a warning (or complain about an unknown option) on 10.14 with gcc/clang.
Comment Actions
> -Wdeclaration-after-statement for gcc and maybe clang. Nice, any idea of how to make it verbosely complaining part of the test-suite ?
-Werror=declaration-after-statement will prevent the test from running at all.
I think setup.py can be adjusted to add some extra compiler options.