abort() is not __declspec(noreturn) in VS2010

Viewed 1801

In my copy of VS2010, stdlib.h contains (lines 353-355)

_CRTIMP __declspec(noreturn) void __cdecl exit(_In_ int _Code);
_CRTIMP __declspec(noreturn) void __cdecl _exit(_In_ int _Code);
_CRTIMP void __cdecl abort(void);

I find it strange that there's no noreturn annotation on abort(). Does anyone know a reason for this? Is it a bug?

EDIT: In VS2008, it's the same, but lines 371-373 of stdlib.h

The lack of the noreturn annotation is triggering error C4716.

Further reference: C++0x proposal for standardization of the noreturn annotation, which says that abort should carry it.

EDIT: Looks like a bunch of discussion disappeared with a deleted answer, but the gist of it is covered in Defect Report #048.

1 Answers
Related