Linux
Leap-15.6, gcc13.3.0, "cb-13667::plugins|compilergcc|depslib|src|cache.c'
The compiler finds that in 'cache.c:L144 sscanf(buf, "%lld %n", &timeval, &n);' ( also L1
"%lld" wait for a 'long long int' and receives a 'time_t' alias 'long int' .
I propose instead "%ld" and a patch.
I can't check for 'MacOs' !
( also L175)
The problem with time_t is that the underlying type is not defined in the standard, some systems use long long int and others long int.
Probably the best solution is just using an intermediate long long int variable in the sscanf and later assign it to timeval (and similar changes in fprintf).
This is my proposal for the issue, is compatible with MSW in 32 and 64 bits and with those environments honouring %lld
My patch compiles OK (no warnings) on MSW and Mint 18, can you check on Leap?
It includes some whitespace corrections, you can ignore them.
For 'Leap-15.6' it's ok.
But here's the result under 'Win-7-64bits, gcc-14.2-seh' in the attached file (warning and corrected cache.c)
These warnings should not appear.
**** The forum is no longer accessible to me. What about you?
We are aware of the forum issue and working on it.
It's strange, there are neither "%d" nor "long long unsigned int" in the patch, and line numbers 147, 178 and 270 do not match (the file has 216 lines).
This should be compatible with everything
Fixed in [r13669].
Related
Commit: [r13669]
Thanks,
With Win-7 : 'cache.c' is good
Line 270 is in 'hash.c'
Thanks for 'r13670' : 'hash.c' is good for 'Win-7::gcc-14.2-seh'
Leap-15.6, gcc-13.3
r13670-wx328, 'compiler depslib' compiles without warning