kmackay / micro-ecc

ECDH and ECDSA for 8-bit, 32-bit, and 64-bit processors.
BSD 2-Clause "Simplified" License
1.26k stars 460 forks source link

int128 usage complaints from GCC pedantic #185

Open geomolin opened 3 years ago

geomolin commented 3 years ago

When doing 64bit GCC builds int128 use gets enabled in types.h:

#if defined(__SIZEOF_INT128__) || ((__clang_major__ * 100 + __clang_minor__) >= 302)
    #define SUPPORTS_INT128 1
#else
    #define SUPPORTS_INT128 0
#endif

This will however cause a warning from the pedantic checker because int128 is not in ISO C.

This is no way to disable int128 at the moment through commandline so I would suggest adding the following:

#ifndef SUPPORTS_INT128
#if defined(__SIZEOF_INT128__) || ((__clang_major__ * 100 + __clang_minor__) >= 302)
    #define SUPPORTS_INT128 1
#else
    #define SUPPORTS_INT128 0
#endif
#endif

With this you can override the use of int128 in any way you like.