[cfe-commits] [PATCH] downgrade an error to a warning to match gcc's behavior

Chris Lattner clattner at apple.com
Sat May 30 12:11:43 PDT 2009

On May 30, 2009, at 10:26 AM, Benjamin Kramer wrote:

> Sebastian Redl wrote:
>> Is this a problem in real code? The program is broken, and will be
>> completely unpredictable at runtime, depending on the mood of the
>> optimizers. I cannot think of a worse thing to let through.
> Yes, it causes the umem freebsd port to fail with clang. The offending
> code is available at
> https://labs.omniti.com/trac/portableumem/browser/trunk/umem_fail.c?rev=49
> #L176
> Some thoughts from #freebsd-clang:
> <Ed> well, as we can see, it's part of real code
> <Ed> and in some cases the compiler doesn't support noreturn
> <Ed> and in that case the compiler will throw warnings about missing
> return statements
> <Ed> so in my opinion it makes sense to place return statements there

I think that downgrading it to a warning that defaults to an error  
makes sense, the compiler can recover easily from it after all.


More information about the cfe-commits mailing list