expand support for noreturn declarations
Although gcc specifies support for declaring a function as noreturn after the function name and parameters, other compilers do so via an attribute at the start of the declaration. Add some macro support for the attribute-at-the-beginning method: o MS Visual Studio compiler o Upcoming C23 standard (untested at this point)
This commit is contained in:
@@ -9,14 +9,14 @@
|
||||
|
||||
int debuggable = 0; /* 1 if we can debug or show a call trace */
|
||||
|
||||
void vms_exit(int);
|
||||
void vms_abort(void);
|
||||
ATTRNORETURN void vms_exit(int);
|
||||
ATTRNORETURN void vms_abort(void);
|
||||
|
||||
/* first arg should be unsigned long but <lib$routines.h> has unsigned int */
|
||||
extern void VDECL(lib$signal, (unsigned, ...));
|
||||
|
||||
/* terminate, converting Unix-style exit code into VMS status code */
|
||||
void
|
||||
ATTRNORETURN void
|
||||
vms_exit(int status)
|
||||
{
|
||||
/* convert non-zero to failure, zero to success */
|
||||
@@ -25,7 +25,7 @@ vms_exit(int status)
|
||||
}
|
||||
|
||||
/* put the user into the debugger; used for abort() when in wizard mode */
|
||||
void
|
||||
ATTRNORETURN void
|
||||
vms_abort(void)
|
||||
{
|
||||
if (debuggable)
|
||||
|
||||
@@ -89,6 +89,8 @@ static struct stat hbuf;
|
||||
|
||||
extern char orgdir[];
|
||||
|
||||
DISABLE_WARNING_UNREACHABLE_CODE
|
||||
|
||||
int
|
||||
get_known_folder_path(
|
||||
const KNOWNFOLDERID * folder_id,
|
||||
@@ -128,6 +130,8 @@ create_directory(const char * path)
|
||||
error("Unable to create directory '%s'", path);
|
||||
}
|
||||
|
||||
RESTORE_WARNING_UNREACHABLE_CODE
|
||||
|
||||
int
|
||||
build_known_folder_path(
|
||||
const KNOWNFOLDERID * folder_id,
|
||||
@@ -1149,6 +1153,8 @@ eraseoldlocks(void)
|
||||
return (1); /* success! */
|
||||
}
|
||||
|
||||
DISABLE_WARNING_UNREACHABLE_CODE
|
||||
|
||||
int
|
||||
getlock(void)
|
||||
{
|
||||
@@ -1288,6 +1294,8 @@ file_exists(const char* path)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
RESTORE_WARNING_UNREACHABLE_CODE
|
||||
|
||||
/*
|
||||
file_newer returns TRUE if the file at a_path is newer then the file
|
||||
at b_path. If a_path does not exist, it returns FALSE. If b_path
|
||||
|
||||
Reference in New Issue
Block a user