Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable pedantic warnings #371

Merged
merged 3 commits into from
Oct 10, 2023
Merged

Conversation

jtraglia
Copy link
Member

@jtraglia jtraglia commented Oct 2, 2023

Last week I learned that -Wall and -Wextra doesn't enable all warnings; there's -Wpedantic too.

When enabled, it had the following warnings (treated as errors):

$ make
In file included from test_c_kzg_4844.c:5:
./tinytest.h:74:56: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
   74 | void tt_execute(const char* name, void (*test_function)())
      |                                                        ^
      |                                                         void
test_c_kzg_4844.c:783:25: error: binary integer literals are a GNU extension [-Werror,-Wgnu-binary-literal]
  783 |     uint32_t original = 0b00000000000000000000000000000000;
      |                         ^
test_c_kzg_4844.c:784:25: error: binary integer literals are a GNU extension [-Werror,-Wgnu-binary-literal]
  784 |     uint32_t reversed = 0b00000000000000000000000000000000;
      |                         ^
test_c_kzg_4844.c:789:25: error: binary integer literals are a GNU extension [-Werror,-Wgnu-binary-literal]
  789 |     uint32_t original = 0b10101000011111100000000000000010;
      |                         ^
test_c_kzg_4844.c:790:25: error: binary integer literals are a GNU extension [-Werror,-Wgnu-binary-literal]
  790 |     uint32_t reversed = 0b01000000000000000111111000010101;
      |                         ^
test_c_kzg_4844.c:795:25: error: binary integer literals are a GNU extension [-Werror,-Wgnu-binary-literal]
  795 |     uint32_t original = 0b11111111111111111111111111111111;
      |                         ^
test_c_kzg_4844.c:796:25: error: binary integer literals are a GNU extension [-Werror,-Wgnu-binary-literal]
  796 |     uint32_t reversed = 0b11111111111111111111111111111111;
      |                         ^
7 errors generated.
make: *** [test_c_kzg_4844] Error 1

src/Makefile Show resolved Hide resolved
@jtraglia
Copy link
Member Author

jtraglia commented Oct 4, 2023

Added these options to other bindings that compile their own C code too. For the java bindings, I needed to disable some of the warnings. It seems that the Windows system has an old version of gcc which doesn't like some things.

Copy link
Contributor

@asn-d6 asn-d6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks!

@asn-d6 asn-d6 merged commit 456c3d8 into ethereum:main Oct 10, 2023
33 checks passed
@jtraglia jtraglia deleted the enable-pedantic-warnings branch August 1, 2024 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants