swami / libinstpatch

Instrument file software library.
Other
20 stars 6 forks source link

v1.1.6 many "ISO C does not allow" warnings during compilation #67

Open Corin-EU opened 2 years ago

Corin-EU commented 2 years ago

When building libinstpatch v1.1.6 with gcc (SUSE Linux) 7.5.0 (no custom CFLAGS used) I see lots of warning messages.

 warning: ISO C does not allow extra ‘;’ outside of a function [-Wpedantic]

 warning: ISO C forbids conversion of object pointer to function pointer type [-Wpedantic]

 warning: ISO C forbids assignment between function pointer and ‘void *’ [-Wpedantic]

 warning: ISO C does not support ‘__PRETTY_FUNCTION__’ predefined identifier [-Wpedantic]

Now I know that warnings are warnings and not errors, but this one in particular because it mentions "overflow", and overflows lead to undefined behavior, should at least be considered for attenton.

 warning: overflow in implicit constant conversion [-Woverflow]
 #define UMAX 65535
derselbst commented 2 years ago

overflows lead to undefined behavior

The only way to fix this is by using the designated initializer syntax. But this would require C99 which would break the build for one of our WindowsXP contributors.

One could take care of the pedantic warnings, yes. But I don't see a benefit in spending time on that.