[cfe-dev] -Wreturn-type regression

Ted Kremenek kremenek at apple.com
Thu Mar 6 23:20:56 PST 2014


Fixed in r203209.

On Mar 6, 2014, at 10:39 PM, İsmail Dönmez <ismail at donmez.ws> wrote:

> Filed PR19074 , thanks!
> 
> 
> On Fri, Mar 7, 2014 at 12:49 AM, Ted Kremenek <kremenek at apple.com> wrote:
> Please file a PR and I’ll take a look.
> 
> On Mar 6, 2014, at 2:32 AM, İsmail Dönmez <ismail at donmez.ws> wrote:
> 
> > Hi,
> >
> > Given the following code
> >
> > #include <stdlib.h>
> >
> > #define av_assert0(cond) do {                                           \
> >     if (!(cond)) {                                                      \
> >         abort();                                                        \
> >     }                                                                   \
> > } while (0)
> >
> > int f(int x) {
> >     switch(x) {
> >         case 0:
> >             return 0;
> >         default:
> >             av_assert0(0);
> >     }
> > }
> >
> > int main()
> > {
> > }
> >
> > [/havana/t]> clang --version
> > clang version 3.4 (branches/release_34 198681)
> > Target: x86_64-suse-linux
> > Thread model: posix
> > [/havana/t]> clang -Wall -Wreturn-type t.c
> > [/havana/t]>
> >
> > No warnings. With recent trunk:
> >
> > [/havana/t]> clang -v
> > clang version 3.5.0 (trunk 202995)
> > [/havana/t]> clang -Wall -Wreturn-type t.c
> > t.c:16:1: warning: control may reach end of non-void function [-Wreturn-type]
> > }
> > ^
> > 1 warning generated.
> >
> > So looks like clang is no longer recognizing abort being a __noreturn__ function.
> >
> > Regards,
> > ismail
> >
> >
> > _______________________________________________
> > cfe-dev mailing list
> > cfe-dev at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140306/78343801/attachment.html>


More information about the cfe-dev mailing list