mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2026-01-22 16:15:59 +00:00
Support #pragma STDC FENV_ROUND FE_DYNAMIC (C23).
This just specifies dynamic rounding mode that can be configured with <fenv.h> calls, like before C23. The other #pragma STDC FENV_ROUND values (specifying static rounding modes) are still not supported.
This commit is contained in:
18
Scanner.pas
18
Scanner.pas
@@ -832,6 +832,7 @@ if list or (numErr <> 0) then begin
|
||||
200: msg := @'variable-length array declarator using * is not allowed here';
|
||||
201: msg := @'variably modified type is not allowed here';
|
||||
202: msg := @'goto or switch enters scope of identifier with variably modified type';
|
||||
203: msg := @'static rounding direction is not supported';
|
||||
end; {case}
|
||||
if extraStr <> nil then begin
|
||||
extraStr^ := concat(msg^,extraStr^);
|
||||
@@ -3843,7 +3844,22 @@ if ch in ['a','d','e','i','l','p','u','w'] then begin
|
||||
if fenvAccess then
|
||||
if doingFunction then
|
||||
fenvAccessInFunction := true;
|
||||
end
|
||||
end {else if}
|
||||
else if (token.name^ = 'FENV_ROUND')
|
||||
and ((cStd >= c23) or not strictMode) then begin
|
||||
NextToken;
|
||||
if token.kind = typedef then
|
||||
token.kind := ident;
|
||||
if token.kind <> ident then
|
||||
Error(9)
|
||||
else if token.name^ <> 'FE_DYNAMIC' then
|
||||
Error(203);
|
||||
if token.kind <> eolsy then begin
|
||||
NextToken;
|
||||
if token.kind <> eolsy then
|
||||
Error(11);
|
||||
end; {if}
|
||||
end {else if}
|
||||
else
|
||||
Error(157);
|
||||
expandMacros := true;
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#pragma STDC FENV_ROUND FE_DYNAMIC
|
||||
|
||||
int main(void) {
|
||||
// labels not preceding a statement
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user