This is what I was getting in ngen's CI workflows. More turned up in the rest of the codebase here
/home/runner/work/ngen/ngen/extern/evapotranspiration/evapotranspiration/src/bmi_pet.c: In function ‘Initialize’:
/home/runner/work/ngen/ngen/extern/evapotranspiration/evapotranspiration/src/bmi_pet.c:80:76: error: format ‘%e’ expects argument of type ‘double’, but argument 2 has type ‘long int’ [-Werror=format=]
80 | printf("the number of time steps from the forcing file is: %8.6e \n", pet->bmi.num_timesteps);
| ~~~~^ ~~~~~~~~~~~~~~~~~~~~~~
| | |
| double long int
| %8.6ld
/home/runner/work/ngen/ngen/extern/evapotranspiration/evapotranspiration/src/bmi_pet.c: In function ‘Get_current_time’:
/home/runner/work/ngen/ngen/extern/evapotranspiration/evapotranspiration/src/bmi_pet.c:517:45: error: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘double’ [-Werror=format=]
517 | printf("Current model time step: '%ld'\n", ((pet_model *) self->data)->bmi.current_time_step);
| ~~^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| long int double
| %f
/home/runner/work/ngen/ngen/extern/evapotranspiration/evapotranspiration/src/bmi_pet.c: In function ‘read_init_config_pet’:
/home/runner/work/ngen/ngen/extern/evapotranspiration/evapotranspiration/src/bmi_pet.c:763:26: error: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long int’ [-Werror=format=]
763 | printf("%d\n", model->bmi.num_timesteps);
| ~^ ~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| int long int
| %ld
/home/runner/work/ngen/ngen/extern/evapotranspiration/evapotranspiration/src/bmi_pet.c:611:9: error: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Werror=unused-result]
611 | fgets(config_line, max_config_line_length + 1, fp);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/runner/work/ngen/ngen/extern/evapotranspiration/evapotranspiration/src/bmi_pet.c: In function ‘Initialize’:
/home/runner/work/ngen/ngen/extern/evapotranspiration/evapotranspiration/src/bmi_pet.c:77:9: error: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Werror=unused-result]
77 | fgets(line_str, max_forcing_line_length + 1, ffp);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/runner/work/ngen/ngen/extern/evapotranspiration/evapotranspiration/src/bmi_pet.c:84:13: error: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Werror=unused-result]
84 | fgets(line_str, max_forcing_line_length + 1, ffp); // read in a line of AORC data.
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
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
[x] Visually tested in supported browsers and devices (see checklist below :point_down:)
[x] Project documentation has been updated (including the "Unreleased" section of the CHANGELOG)
[x] Reviewers requested with the Reviewers tool :arrow_right:
Changes
printf
format specifiers to argument typesfgets
Testing
Screenshots
This is what I was getting in ngen's CI workflows. More turned up in the rest of the codebase here
Checklist
Testing checklist
Target Environment support