Closed xandark closed 3 years ago
Hi, thanks for the note. The multi char constants may be implementation defined. I don't have Linux... Apple clang (both cc
and gcc
) compiles this with no errors/warnings. If your header include produces valid output despite the warnings, then you're all set. If it doesn't then the constants need more verbose assignment which you can edit for directly, or let me know and I'll get around to it. Thanks for the heads-up.
I had the same problem in linux and gcc.
#include <inttypes.h>
#define S2I(x) ((((uint32_t)x[0]<<24) + ((uint32_t)x[1]<<16) + ((uint32_t)x[2]<<8) + ((uint32_t)x[3])))
and replaced 'WOZ2' with S2I("WOZ2") and the other single quote strings accordingly.
This makes the solution less compiler dependent.
I modified the main c file to include stdint.h and stopped using the multi char literals. Hopefully this works for you folks without further edits. Thanks for flagging the challenges here.
Works great. Thanks!
Yep, builds flawlessly on Linux with GCC, thanks!
Compiling under Ubuntu Linux 20.04 with gcc 9.3, I get immediate compile errors:
From this stackoverflow post, it seems that Visual C doesn't know about
#include <stdint.h>
. When I added it back, it compiled fine, but spit out 5 warnings aboutmulti-character character constant [-Wmultichar]
, like 'WOZ2', 'INFO', etc. The program runs, but if these warnings are to be ignored, you can let us know in the compilation step.