Skip to content

Restore some C89 compliance (variable declarations in for loops)#54

Merged
stevengj merged 2 commits intoNanoComp:masterfrom
thchr:master
Feb 13, 2020
Merged

Restore some C89 compliance (variable declarations in for loops)#54
stevengj merged 2 commits intoNanoComp:masterfrom
thchr:master

Conversation

@thchr
Copy link
Contributor

@thchr thchr commented Feb 13, 2020

Attempt to address #53 (comment) and get CI back for MPB.

There are a lot of variable declarations in utils/test-prism.c that are not at the beginning of blocks; I think that is nominally not C89/90 compliant, but if I understand correctly it should not be a problem under gcc.
Thus, I just restricted myself to fixing the declarations inside loop blocks.

I also added an exclusion of .dat files to .gitignore, which are generated when running the libctl checks now.

@stevengj stevengj merged commit ea13876 into NanoComp:master Feb 13, 2020
@stevengj
Copy link
Collaborator

The geom.c and main.c, along with the public headers, are compiled directly by external packages using libctl, so we aren't under control of the compiler flags used for these files. Hence we should ensure that they compile under both C90 and C99.

For test programs etcetera we control the compiler flags so we can use C99 features there if we want. If we rely on C99 features for the test programs we should probably have a AC_PROG_CC_C99 line in the configure.ac script, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants