-Wreturn-type regression

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

Ted, this might be interesting for you since you have been doing
changes in this area recently.

Dmitri

Please file a PR and I’ll take a look.

Filed PR19074 , thanks!

Fixed in r203209.