-
Notifications
You must be signed in to change notification settings - Fork 15.4k
Closed as duplicate of#111509
Closed as duplicate of#111509
Copy link
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillaclang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerduplicateResolved as duplicateResolved as duplicatefalse-positiveWarning fires when it should notWarning fires when it should not
Description
| Bugzilla Link | 11542 |
| Version | 3.0 |
| OS | FreeBSD |
| CC | @efriedma-quic,@tkremenek |
Extended Description
I suspect this bug is similar to bug 9599, but not identical, so I'm filing this anyway.
The following code generates a -Wreturn-type warning:
__attribute__((__noreturn__)) void bar(void);
static void
foo(void)
{
bar();
}
int
f(void)
{
foo();
}foo.c:15:1: warning: control reaches end of non-void function [-Wreturn-type]
If I change the call to foo() to bar(), it obviously work, but in this case the compiler should be to derive to a certain extent that foo() isn't going to return anyway. This information should be available anyway, as for this specific C file, foo() is even inlined into bar() completely.
Metadata
Metadata
Assignees
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillaclang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerduplicateResolved as duplicateResolved as duplicatefalse-positiveWarning fires when it should notWarning fires when it should not