mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2024-06-02 00:41:32 +00:00
Require that main have no function specifiers.
This enforces a constraint in the C standards (for a hosted environment).
This commit is contained in:
parent
913052fe7c
commit
f54d0e1854
|
@ -3781,6 +3781,10 @@ if isFunction then begin
|
||||||
if isInline then
|
if isInline then
|
||||||
if declSpecifiers.storageClass <> staticsy then
|
if declSpecifiers.storageClass <> staticsy then
|
||||||
Error(120);
|
Error(120);
|
||||||
|
if isInline or isNoreturn then
|
||||||
|
if not (isNewDeskAcc or isClassicDeskAcc or isCDev or isNBA or isXCMD) then
|
||||||
|
if variable^.name^ = 'main' then
|
||||||
|
Error(181);
|
||||||
if alignmentSpecified then
|
if alignmentSpecified then
|
||||||
Error(142);
|
Error(142);
|
||||||
if _Thread_localsy in declSpecifiers.declarationModifiers then
|
if _Thread_localsy in declSpecifiers.declarationModifiers then
|
||||||
|
|
|
@ -775,6 +775,7 @@ if list or (numErr <> 0) then begin
|
||||||
178: msg := @'_Thread_local may not appear in a function declaration';
|
178: msg := @'_Thread_local may not appear in a function declaration';
|
||||||
179: msg := @'_Pragma requires one string literal argument';
|
179: msg := @'_Pragma requires one string literal argument';
|
||||||
180: msg := @'decimal digit sequence expected';
|
180: msg := @'decimal digit sequence expected';
|
||||||
|
181: msg := @'''main'' may not have any function specifiers';
|
||||||
otherwise: Error(57);
|
otherwise: Error(57);
|
||||||
end; {case}
|
end; {case}
|
||||||
writeln(msg^);
|
writeln(msg^);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user