briansmith / ring

Safe, fast, small crypto using Rust
Other
3.69k stars 697 forks source link

Building C code fails due to `-pedantic` flag #1923

Closed tmfink closed 7 months ago

tmfink commented 7 months ago

Ring fails to build in my company's build environment due to the -pedantic compiler flag for "non MSVC" targets. Our build sysroot has wrapper headers headers that use #include_next.

Since include_next is a GCC extension (which is disabled with -pedantic), this results in an error when compiling the C code:

error: #include_next is a GCC extension
   28 | #include_next <stdint.h>
      |  ^~~~~~~~~~~~

Problematic line: https://github.com/briansmith/ring/blob/73fb637078ea1a37719cf0c5f3055f9a18dcc1e0/build.rs#L114

At a minimum, I think there should be a way to disable this with an environment variable. However, since whether or not the -pedantic flag can be used depends on the target sysroot , I don't think the -pedantic flag should be enabled by default (although I understand if you want to enable in CI builds).

I'm happy to submit a PR if you tell me how you would want to conditionally enable it.

briansmith commented 7 months ago

I would take a PR to remove the -pedantic completely from build.rs.

emabee commented 7 months ago

A new ring version with this fix would be highly appreciated :-) Is there some timeline planned already?

tmfink commented 7 months ago

Fixed in #1926