https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93054

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to prathamesh3492 from comment #1)
> I wonder if we should emit an error in the front-end if a noreturn function
> has non-void return type ? For above test-case, the function cb() is marked
> with noreturn attribute but has return-type int.

There is a warning emitted from the front-end about the noreturn but with a
return:
t9.c: In function ‘cb’:
t9.c:7:10: warning: function declared ‘noreturn’ has a ‘return’ statement
    7 |   return bp (cb ());
      |          ^~~~~~~~~~

Reply via email to