[cfe-commits] r91073 - in /cfe/trunk: lib/Sema/SemaDecl.cpp test/Sema/return.c
Mike Stump
mrs at apple.com
Thu Dec 10 17:42:19 PST 2009
On Dec 10, 2009, at 4:08 PM, Chris Lattner wrote:
> On Dec 10, 2009, at 2:57 PM, Mike Stump wrote:
>
>> Author: mrs
>> Date: Thu Dec 10 16:57:48 2009
>> New Revision: 91073
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=91073&view=rev
>> Log:
>> Don't complain about falling off the end of a function with an asm
>> block, if the function is supposed to return a value as we don't know
>> exactly what the asm code does.
>
> Why?
Because people write code like:
void* t4(void) { __asm mov eax, fs:[0x10] }
> A fix to silence the warning is to use __builtin_unreachable() after the asm.
But that point is reachable.
Also, int foo() { asm("a: jump a"); } doesn't fall off the end. Essentially, trying to understand what is inside the asm is a dangerous thing.
More information about the cfe-commits
mailing list