[Bug c/98945] gcc does not warn when assigning value of type int (*)() to variable of type int (*)(double)
msebor at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Feb 3 00:45:03 GMT 2021
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98945
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
See Also| |https://gcc.gnu.org/bugzill
| |a/show_bug.cgi?id=97882
Ever confirmed|0 |1
Keywords| |diagnostic
CC| |msebor at gcc dot gnu.org
Status|UNCONFIRMED |NEW
Last reconfirmed| |2021-02-03
--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
Confirmed. It's somewhat related to pr97882 in that the warning depends on the
result of comp_target_types() which considers int (*)(double) compatible with
int(*)() but int (*)(float) incompatible. The warning is issued in
convert_for_assignment().
Interestingly, on Godbolt, both Clang and ICC behave just like GCC. Only MSVC
warns for both assignments.
More information about the Gcc-bugs
mailing list