From f59c2cf93dcb91d8d4de13678e73915ead3338b4 Mon Sep 17 00:00:00 2001 From: Stephen Heumann Date: Tue, 27 Aug 2024 22:06:55 -0500 Subject: [PATCH] Add a C23 standard option to the compiler. The default is still c17compat. --- Scanner.pas | 8 ++++++++ Table.asm | 1 + Table.pas | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Scanner.pas b/Scanner.pas index 7a9054f..e69d487 100644 --- a/Scanner.pas +++ b/Scanner.pas @@ -4895,6 +4895,14 @@ repeat cStd := c17; strictMode := true; end {else if} + else if (stdName^ = 'c23compat') or (stdName^ = 'c24compat') then begin + cStd := c23; + strictMode := false; + end {else if} + else if (stdName^ = 'c23') or (stdName^ = 'c24') then begin + cStd := c23; + strictMode := true; + end {else if} else FlagErrorAndSkip; end {else if} diff --git a/Table.asm b/Table.asm index e4aa1ca..ab47857 100644 --- a/Table.asm +++ b/Table.asm @@ -953,6 +953,7 @@ stdcVersion start __STDC_VERSION__ values dc i4'199901' c99 dc i4'201112' c11 dc i4'201710' c17 + dc i4'202311' c23 end macRomanToUCS start diff --git a/Table.pas b/Table.pas index ea8225e..d450331 100644 --- a/Table.pas +++ b/Table.pas @@ -22,7 +22,7 @@ var charSym: array[minChar..maxChar] of tokenEnum; {symbols for single char symbols} reservedWords: array[_Alignassy..whilesy] of string[14]; {reserved word strings} wordHash: array[0..25] of tokenEnum; {for hashing reserved words} - stdcVersion: array[c95..c17] of longint; {__STDC_VERSION__ values} + stdcVersion: array[c95..c23] of longint; {__STDC_VERSION__ values} {from ASM.PAS} {------------}