ethereum / c-kzg-4844

A minimal implementation of the Polynomial Commitments API for EIP-4844 and EIP-7594, written in C.
Apache License 2.0
112 stars 105 forks source link

Enable more compiler warnings #480

Closed jtraglia closed 1 month ago

jtraglia commented 1 month ago

So once again, I feel like I've been tricked by the compiler. I thought that -Wall -Wextra was everything, but it's not.

This PR enables these warnings & fixes the issues. The most noticeable change is probably the due to the implicit conversions from uint64_t to uint32_t to int etc that we were doing. Rather than dealing with conversions, we can use uint64_t in these places. I actually like this better & think we should have done this from the beginning.

See this link for a list of flags. Not all of them are listed here 🤷

https://gcc.gnu.org/onlinedocs/gcc-4.4.0/gcc/Warning-Options.html#Warning-Options

asn-d6 commented 1 month ago

This PR does not build on my Linux system. I'm using clang version 16.0.6 (27+b1). Maybe you are building with gcc?

jtraglia commented 1 month ago

I'm actually using Apple's clang. They have their own fork if I understand correctly.

$ clang -v
Apple clang version 15.0.0 (clang-1500.3.9.4)

What are the issues?

asn-d6 commented 1 month ago

The issues were an artifact of a separate build system issue. Will address on another PR.