supranational / blst

Multilingual BLS12-381 signature library
Apache License 2.0
458 stars 175 forks source link

fix building with older gcc #166

Closed MatusKysel closed 1 year ago

MatusKysel commented 1 year ago

Older version of gcc (below 5.0) have issues with building this library. Adding this flag should solve this

dot-asm commented 1 year ago

This is not right. You say "this flag should solve this" in the context of gcc, but it doesn't. -std=c99 puts gcc into "strict ANSI" mode and then it can't compile vect.h. -std=gnu99 would do it, but formally it wouldn't be considered appropriate to just shove the flag, because it overrides the default, which can be considered more suitable. General advice is to pass system-specific flags as extra arguments to the build script, e.g. as ./build.sh -std=gnu99. But if we choose to add it in the build script, it would be more appropriate to query the compiler default and add the flag only if it's lower than 99.