Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#15955 closed bug (fixed)

`abort` function not marked as `noreturn`

Reported by: ahwayakchih Owned by: nobody
Priority: normal Milestone: R1/beta2
Component: System/POSIX Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

I'm trying to build a C++ project, which has declarations like:

[[noreturn]] inline void Abort() {
    /* some code here, and then... */
    abort();
}

It errors when compiling, because abort() declared in Haiku is not marked as noreturn. I added call to exit(-1) at the end of function, but that's a bit ugly workaround.

Since abort() never returns anyway (or does it?), it should be ok to mark it as such, right? So, in stdlib.h, instead of:

extern void abort(void);

there could be:

extern void abort(void) __attribute__((noreturn));

Change History (4)

comment:2 by waddlesplash, 4 years ago

Resolution: fixed
Status: newclosed

Fix merged in hrev54125.

comment:3 by ahwayakchih, 4 years ago

Thanks @pulkomandy and @waddlesplash :).

comment:4 by nielx, 4 years ago

Milestone: UnscheduledR1/beta2

Assign tickets with status=closed and resolution=fixed within the R1/beta2 development window to the R1/beta2 Milestone

Note: See TracTickets for help on using tickets.