Skip to content

I think this format specifier needs to change also

Jordy Aaldering requested to merge is-this-fmt-wrong into develop

Quinten's stack trace merge request is failing due to an unrelated bug (which somehow did not pop up sooner).

I can reproduce it on my system, even without Quinten's traces.

It seems that the reason is an incorrect format specifier.


I am unsure of the proper solution. Do we get PRIisac2c from libsac2c's types.h, or from sacinterface.h? And how?


Here is the error from Quinten's pipeline

/builds/sac-group/sac2c/build/sac2c-debug/src/sac2c-debug-build/sac2c_d -v0 -cppI/builds/sac-group/sac2c/build/sac2c-debug/src/sac2c-debug-build/tests -check tc -o test-issue-2255 test-issue-2255.sac
/builds/sac-group/sac2c/build/sac2c-debug/src/sac2c-debug-build/tests/test-issue-2255.c: In function ‘SACf__MAIN__ex__i’:
/builds/sac-group/sac2c/build/sac2c-debug/src/sac2c-debug-build/tests/test-issue-2255.c:1029:177: error: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘int64_t’ {aka ‘long int’} [-Werror=format=]
 1029 |     SAC_ND_PRF_VAL_LE_VAL_SxS("./test-issue-2255.sac", 12, 17, (SACp_emal_5739__uprf_1883, (SCL, (NHD, (NUQ, (INT, (GLO, (NON, (NOT, (BOO, ))))))))), (SACp_emal_5743__isaa_2216_x, (SCL, (NHD, (NUQ, (INT, (GLO, (NON, (NOT, (INT, ))))))))), (SACl_x, (SCL, (NHD, (NUQ, (INT, (GLO, (FPM, (NOT, (INT, ))))))))))
      |                                                                                                                                                                                 ^~~~~~~~~~~~~~~~~~~~~                                                                                      ~~~~~~~~~~~~~~~~~~~~~~~    
      |                                                                                                                                                                                                                                                                                            |
      |                                                                                                                                                                                                                                                                                            int64_t {aka long int}

https://gitlab.sac-home.org/sac-group/sac2c/-/pipelines/3305

Edited by Jordy Aaldering

Merge request reports