https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108310
Bug ID: 108310
Summary: Some warnings that -Wtraditional-conversion causes to
be emitted aren't actually controlled by it
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Keywords: diagnostic, easyhack
Severity: trivial
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: egallager at gcc dot gnu.org
CC: msebor at gcc dot gnu.org
Target Milestone: ---
So, I'm having trouble crafting a testcase that properly reproduces this issue,
but let's see if we can do this just by looking at the source: in
gcc/c/c-typeck.cc, starting at line 3464 (as it currently exists), there is a
block of code that emits some warnings from -Wtraditional-conversion:
https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/c/c-typeck.cc;h=e06f052eb46a72d3d50835330c5af975e7c52084;hb=HEAD#l3464
However, instead of being called like:
warning_at (ploc, OPT_Wtraditional_conversion, "");
like the rest of the warnings in the area, these two are just called like:
warning_at (ploc, 0, "");
This means that when the warning actually gets printed, the flag controlling
it, [-Wtraditional-conversion], isn't actually printed alongside it. `git
blame` says that Martin Sebor was the last person to touch this code in
r9-4484-g550dfbdcf6d93d. I might be able to fix this myself if someone can
confirm for me that this is an actual mistake that ought to be fixed (of
course, anyone else is welcome to fix it first!).