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