For a function declared "noreturn" the compiler cannot verify that inline
assembler code in the function body indeed does not return and therefore
produces the warning "'noreturn' function does return". I would like a
mechanism to tell the compiler that an inline assembler statement makes a
function "noreturn" without the overhead of adding an endless loop at the end
of the function. Something like: asm volatile ("...") __attribute__((noreturn))

An example:

__attribute__((noreturn))
void func()
{
    asm volatile ("1: jmp 1b");
}

int main()
{
    func();
    return 0;
}


-- 
           Summary: Cannot flag inline assembler code "noreturn"
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: inline-asm
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: us15 at os dot inf dot tu-dresden dot de


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32811

Reply via email to