Re: Definition of BUG on x86

H. Peter Anvin
2009-02-19T18:42:01Z

Petr Tesarik wrote:
>
> Ah, yes, you're right. If you want to make gcc aware of the fact that a
> function never returns, it must recognize that there is no path to that
> function's EXIT, otherwise it will emit a warning (which is pretty
> annoying, indeed). Since we don't want to make a call/jmp to an external
> noreturn function, so the no-return code must be directly visible to
> gcc. Unfortunately, there is no way of telling gcc that an asm statement
> does not return.
>

At Transmeta, we had an internal hack to gcc that added
__builtin_not_reached(); for this particular reason. This would
probably be the best way to handle this.

-hpa

--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.