mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2024-12-22 07:30:54 +00:00
Prohibit _Noreturn specifier on non-functions.
This commit is contained in:
parent
bc1f6eb457
commit
a130e79929
@ -3122,6 +3122,7 @@ var
|
||||
i: integer; {loop variable}
|
||||
isAsm: boolean; {has the asm modifier been used?}
|
||||
isInline: boolean; {has the inline specifier been used?}
|
||||
isNoreturn: boolean; {has the _Noreturn specifier been used?}
|
||||
lDoingParameters: boolean; {local copy of doingParameters}
|
||||
lisPascal: boolean; {local copy of isPascal}
|
||||
lp,tlp,tlp2: identPtr; {for tracing parameter list}
|
||||
@ -3367,6 +3368,7 @@ DeclarationSpecifiers(declarationSpecifiersElement, ident);
|
||||
isPascal := pascalsy in functionSpecifiers;
|
||||
isAsm := asmsy in functionSpecifiers;
|
||||
isInline := inlinesy in functionSpecifiers;
|
||||
isNoreturn := _Noreturnsy in functionSpecifiers;
|
||||
lisPascal := isPascal;
|
||||
if not skipDeclarator then begin
|
||||
variable := nil;
|
||||
@ -3657,6 +3659,8 @@ else {if not isFunction then} begin
|
||||
end; {if}
|
||||
if isInline then
|
||||
Error(119);
|
||||
if isNoreturn then
|
||||
Error(141);
|
||||
if token.kind = eqch then begin
|
||||
if storageClass = typedefsy then
|
||||
Error(52);
|
||||
|
@ -662,6 +662,7 @@ if list or (numErr <> 0) then begin
|
||||
138: msg := @'unsupported alignment';
|
||||
139: msg := @'thread-local storage is not supported by ORCA/C';
|
||||
140: msg := @'unexpected token';
|
||||
141: msg := @'_Noreturn specifier is only allowed on functions';
|
||||
otherwise: Error(57);
|
||||
end; {case}
|
||||
writeln(msg^);
|
||||
|
Loading…
Reference in New Issue
Block a user