Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: joe at perches dot com
Target Milestone: ---
This code does not emit a fallthrough warning:
int foo(int i)
{
switch (i) {
case 1:
i = 0;
default:
break;
}
return i
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: joe at perches dot com
Target Milestone: ---
A possibly useful addition similar to:
__attribute__((warn_unused_result))
might be
__attribute__((warn_untested_result))
for things like
rsion: 4.9.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: joe at perches dot com
Created attachment 35365
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35365&
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65812
--- Comment #3 from Joe Perches ---
Thank you both for your very prompt replies.
It might be useful to have a -Wunused-eliminated type extra warning
though that might be very noisy.
nedTo: unassigned at gcc dot gnu dot org
ReportedBy: joe at perches dot com
GCC build triplet: i486-linux-gnu
GCC host triplet: i486-linux-gnu
GCC target triplet: i486-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42382
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91432
--- Comment #7 from Joe Perches ---
What could be useful is to add yet another --extra-strict-fallthrough warning
flag that would make it possible for these cases to have a warning.