[Bug c/60440] [12/13/14/15 Regression] Bogus -Wreturn-type warning after error
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Mar 7 18:03:36 GMT 2025
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60440
--- Comment #16 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Andrew Pinski <pinskia@gcc.gnu.org>:
https://gcc.gnu.org/g:cf65235e03d2eb1667624943eae8f7fc355bceaf
commit r15-7894-gcf65235e03d2eb1667624943eae8f7fc355bceaf
Author: Andrew Pinski <quic_apinski@quicinc.com>
Date: Thu Mar 6 16:07:02 2025 -0800
c: Fix warning after an error on a return statment [PR60440]
Like r5-6912-g3dbb84276aca10 but this is for the C front-end.
Basically we have an error on a return statement, we just return
error_mark_node and then the warning happens as there is no return
statement. Anyways instead mark the current function for supression
of the warning instead.
PR c/60440
gcc/c/ChangeLog:
* c-typeck.cc (c_finish_return): Mark the current function
for supression of the -Wreturn-type if there was an error
on the return statement.
gcc/testsuite/ChangeLog:
* gcc.dg/Wreturn-mismatch-2.c: Change dg-warning
for the last -Wreturn-type to dg-bogus.
* gcc.dg/pr60440-1.c: New test.
Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
More information about the Gcc-bugs
mailing list