Open sobolevn opened 1 month ago
cc @nohlson @sethmlarson
In fact, We can add -Wno-implicit-fallthrough
to suppress it, Because this warning only means that the case
statement has no break
.
(Although this will result in no warning being triggered if the user writes a statement without a break).
@rruuaanng
We can add
-Wno-implicit-fallthrough
to suppress it
I think that we should not add anything here, because we are working with a vendored module that cannot be modified (without a very strong reason to).
Although this will result in no warning being triggered if the user writes a statement without a break
Again, developers should not touch vendored libs without a very strong reason. Fixing such a warning is not good enough reason to do so.
I'm in agreement that we shouldn't be warning on code we don't control. Our current setup for warning tooling applies the warning to all code covered by CFLAGS_NODIST
, so even if the warnings don't cause CI to fail they still show up in logs. I don't know if there's an easy way to ignore whole directories that we vendor at the configure
level to not apply warnings to those files?
I don't know if there's an easy way to ignore whole directories that we vendor at the
configure
level to not apply warnings to those files?
We don't have such functionality in configure.ac
, but you should be fine with adding -Wno-implicit-fallthrough
after -Wimplicit-fallthrough
. I don't remember from the top of my head if LIBEXPAT_CFLAGS
are added before or after CFLAGS_NODIST
, but if LIBEXPAT_CFLAGS
are added post CFLAGS_NODIST
, getting rid of those warnings for libexpat should be pretty trivial[^1].
[^1]: a trivial, but dirty, hack in Makefile.pre.in
, that is
Bug report
Right now compilers produce a lot of warnings for vendored modules:
But, there's not much we can do about them, since they are vendored. For example,
siphash
has explicit fall-through comments:https://github.com/python/cpython/blob/92af191a6a5f266b71373f5374ca0c9c522d62d9/Modules/expat/siphash.h#L235-L243
But, it is still reported:
My opinion is that we only should show actionable warnings, that we can actually fix.
CC @hugovk