cmake builds may fail with compilers that default to older C standards.
There are several loops in the code with the following structure:
for( int i = 0; i < INPUT_VAR_NAME_COUNT; i++){
}
This is illegal syntax in C standards prior to 99, and would require each of these loops to be re-written as such
int i = 0;
for( i = 0; i < INPUT_VAR_NAME_COUNT; i++){
}
I don't think in 2022 it is unreasonable to simply require a C compiler that supports the C99 standard that allows the first syntax to work as intended. This PR simply forces CMake to pass the --std=C99 to the complier to ensure the build will pass for any compiler that supports a --std flag.
Changes
Make C99 standard required for building the library.
Testing
Tested the configuration and build using gcc 4.8.5
Checklist
[x] PR has an informative and human-readable title
[x] Changes are limited to a single goal (no scope creep)
[x] Code can be automatically merged (no conflicts)
[x] Code follows project standards (link if applicable)
[x] Passes all existing automated tests
[x] Any change in functionality is tested
[x] New functions are documented (with a description, list of inputs, and expected output)
[x] Placeholder code is flagged / future todos are captured in comments
[ ] Project documentation has been updated (including the "Unreleased" section of the CHANGELOG)
[x] Reviewers requested with the Reviewers tool :arrow_right:
cmake builds may fail with compilers that default to older C standards. There are several loops in the code with the following structure:
This is illegal syntax in C standards prior to 99, and would require each of these loops to be re-written as such
I don't think in 2022 it is unreasonable to simply require a C compiler that supports the C99 standard that allows the first syntax to work as intended. This PR simply forces CMake to pass the
--std=C99
to the complier to ensure the build will pass for any compiler that supports a--std
flag.Changes
Testing
Checklist
Target Environment support