IDE: Add compiler option -Sy to project settings. Remove obsolete option -St. Issue .

This commit is contained in:
Juha 2023-05-15 10:55:45 +03:00
parent 600d7f8666
commit 42bd508311
4 changed files with 37 additions and 37 deletions

View File

@ -195,7 +195,7 @@ type
procedure SetSmartLinkUnit(const AValue: Boolean);
procedure SetStackChecks(const AValue: Boolean);
procedure SetStackSize(const AValue: Integer);
procedure SetStaticKeyword(const AValue: Boolean);
procedure SetPointerTypeCheck(const AValue: Boolean);
procedure SetStopAfterErrCount(const AValue: integer);
procedure SetStripSymbols(const AValue: Boolean);
procedure SetSyntaxMode(const AValue: string);
@ -232,7 +232,7 @@ type
fCPPInline: Boolean;
fCMacros: Boolean;
fInitConst: Boolean;
fStaticKeyword: Boolean;
fPointerTypeCheck: Boolean;
// Code generation:
fSmartLinkUnit: Boolean;
fRelocatableUnit: Boolean;
@ -397,7 +397,7 @@ type
property CPPInline: Boolean read fCPPInline write SetCPPInline;
property CStyleMacros: Boolean read fCMacros write SetCMacros;
property InitConstructor: Boolean read fInitConst write SetInitConst;
property StaticKeyword: Boolean read fStaticKeyword write SetStaticKeyword;
property PointerTypeCheck: Boolean read fPointerTypeCheck write SetPointerTypeCheck;
// code generation:
property IOChecks: Boolean read fIOChecks write SetIOChecks;
@ -844,10 +844,10 @@ begin
IncreaseChangeStamp;
end;
procedure TLazCompilerOptions.SetStaticKeyword(const AValue: Boolean);
procedure TLazCompilerOptions.SetPointerTypeCheck(const AValue: Boolean);
begin
if fStaticKeyword=AValue then exit;
fStaticKeyword:=AValue;
if fPointerTypeCheck=AValue then exit;
fPointerTypeCheck:=AValue;
IncreaseChangeStamp;
end;

View File

@ -1592,11 +1592,11 @@ begin
CStyleOperators := aXMLConfig.GetValue(p+'CStyleOperator/Value', true);
IncludeAssertionCode := aXMLConfig.GetValue(p+'IncludeAssertionCode/Value', false);
AllowLabel := aXMLConfig.GetValue(p+'AllowLabel/Value', true);
UseAnsiStrings := aXMLConfig.GetValue(p+'UseAnsiStrings/Value', FileVersion>=9);
CPPInline := aXMLConfig.GetValue(p+'CPPInline/Value', true);
CStyleMacros := aXMLConfig.GetValue(p+'CStyleMacros/Value', false);
InitConstructor := aXMLConfig.GetValue(p+'InitConstructor/Value', false);
StaticKeyword := aXMLConfig.GetValue(p+'StaticKeyword/Value', false);
UseAnsiStrings := aXMLConfig.GetValue(p+'UseAnsiStrings/Value', FileVersion>=9);
PointerTypeCheck := aXMLConfig.GetValue(p+'PointerTypeCheck/Value', false);
{ CodeGeneration }
p:=Path+'CodeGeneration/';
@ -1810,11 +1810,11 @@ begin
aXMLConfig.SetDeleteValue(p+'CStyleOperator/Value', CStyleOperators,true);
aXMLConfig.SetDeleteValue(p+'IncludeAssertionCode/Value', IncludeAssertionCode,false);
aXMLConfig.SetDeleteValue(p+'AllowLabel/Value', AllowLabel,true);
aXMLConfig.SetDeleteValue(p+'UseAnsiStrings/Value', UseAnsiStrings,true);
aXMLConfig.SetDeleteValue(p+'CPPInline/Value', CPPInline,true);
aXMLConfig.SetDeleteValue(p+'CStyleMacros/Value', CStyleMacros,false);
aXMLConfig.SetDeleteValue(p+'InitConstructor/Value', InitConstructor,false);
aXMLConfig.SetDeleteValue(p+'StaticKeyword/Value', StaticKeyword,false);
aXMLConfig.SetDeleteValue(p+'UseAnsiStrings/Value', UseAnsiStrings,true);
aXMLConfig.SetDeleteValue(p+'PointerTypeCheck/Value', PointerTypeCheck,false);
{ CodeGeneration }
p:=Path+'CodeGeneration/';
@ -3252,8 +3252,8 @@ begin
tempsw := tempsw + 'm';
if (InitConstructor) then
tempsw := tempsw + 's';
if (StaticKeyword) then
tempsw := tempsw + 't';
if (PointerTypeCheck) then
tempsw := tempsw + 'y';
end;
if (tempsw <> '') then begin
@ -3307,11 +3307,11 @@ begin
fCStyleOp := true;
fIncludeAssertionCode := false;
fAllowLabel := true;
fUseAnsiStr := true;
fCPPInline := true;
fCMacros := false;
fInitConst := false;
fStaticKeyword := false;
fUseAnsiStr := true;
fPointerTypeCheck := false;
// code generation
fSmartLinkUnit := false;
@ -3415,11 +3415,11 @@ begin
fCStyleOp := CompOpts.fCStyleOp;
fIncludeAssertionCode := CompOpts.fIncludeAssertionCode;
fAllowLabel := CompOpts.fAllowLabel;
fUseAnsiStr := CompOpts.fUseAnsiStr;
fCPPInline := CompOpts.fCPPInline;
fCMacros := CompOpts.fCMacros;
fInitConst := CompOpts.fInitConst;
fStaticKeyword := CompOpts.fStaticKeyword;
fUseAnsiStr := CompOpts.fUseAnsiStr;
fPointerTypeCheck := CompOpts.fPointerTypeCheck;
// Code Generation
fSmartLinkUnit := CompOpts.SmartLinkUnit;
@ -3564,11 +3564,11 @@ begin
if Done(Tool.AddDiff('CStyleOp',fCStyleOp,CompOpts.fCStyleOp)) then exit;
if Done(Tool.AddDiff('IncludeAssertionCode',fIncludeAssertionCode,CompOpts.fIncludeAssertionCode)) then exit;
if Done(Tool.AddDiff('AllowLabel',fAllowLabel,CompOpts.fAllowLabel)) then exit;
if Done(Tool.AddDiff('UseAnsiStr',fUseAnsiStr,CompOpts.fUseAnsiStr)) then exit;
if Done(Tool.AddDiff('CPPInline',fCPPInline,CompOpts.fCPPInline)) then exit;
if Done(Tool.AddDiff('CMacros',fCMacros,CompOpts.fCMacros)) then exit;
if Done(Tool.AddDiff('InitConst',fInitConst,CompOpts.fInitConst)) then exit;
if Done(Tool.AddDiff('StaticKeyword',fStaticKeyword,CompOpts.fStaticKeyword)) then exit;
if Done(Tool.AddDiff('UseAnsiStr',fUseAnsiStr,CompOpts.fUseAnsiStr)) then exit;
if Done(Tool.AddDiff('PointerTypeCheck',fPointerTypeCheck,CompOpts.fPointerTypeCheck)) then exit;
// code generation
if Tool<>nil then Tool.Path:='Code';

View File

@ -121,13 +121,13 @@ begin
AutoSize := True;
Caption := dlgSyntaxOptions;
Items.BeginUpdate;
Items.Add(dlgCOCOps + ' (-Sc, {$COPERATORS ON})');
Items.Add(dlgLabelGoto + ' (-Sg, {$GOTO ON})');
Items.Add(dlgCppInline + ' (-Si, {$INLINE ON})');
Items.Add(dlgCMacro + ' (-Sm, {$MACRO ON})');
Items.Add(dlgInitDoneOnly + ' (-Ss)');
Items.Add(dlgStaticKeyword + ' (-St)');
Items.Add(dlgCOAnsiStr + ' (-Sh, {$H+})');
Items.Add(dlgCOCOps + ' (-Sc, {$COPERATORS ON})');
Items.Add(dlgLabelGoto + ' (-Sg, {$GOTO ON})');
Items.Add(dlgCOAnsiStr + ' (-Sh, {$H+})');
Items.Add(dlgCppInline + ' (-Si, {$INLINE ON})');
Items.Add(dlgCMacro + ' (-Sm, {$MACRO ON})');
Items.Add(dlgInitDoneOnly + ' (-Ss)');
Items.Add(dlgPointerTypeCheck+ ' (-Sy, {$T+})');
Items.EndUpdate;
end;
end;
@ -151,11 +151,11 @@ begin
begin
Checked[0] := CStyleOperators;
Checked[1] := AllowLabel;
Checked[2] := CPPInline;
Checked[3] := CStyleMacros;
Checked[4] := InitConstructor;
Checked[5] := StaticKeyword;
Checked[6] := UseAnsiStrings;
Checked[2] := UseAnsiStrings;
Checked[3] := CPPInline;
Checked[4] := CStyleMacros;
Checked[5] := InitConstructor;
Checked[6] := PointerTypeCheck;
end;
end;
end;
@ -171,12 +171,12 @@ begin
with grpSyntaxOptions do
begin
CStyleOperators := Checked[0];
AllowLabel := Checked[1];
CPPInline := Checked[2];
CStyleMacros := Checked[3];
InitConstructor := Checked[4];
StaticKeyword := Checked[5];
UseAnsiStrings := Checked[6];
AllowLabel := Checked[1];
UseAnsiStrings := Checked[2];
CPPInline := Checked[3];
CStyleMacros := Checked[4];
InitConstructor := Checked[5];
PointerTypeCheck:= Checked[6];
end;
end;
end;

View File

@ -2346,7 +2346,7 @@ resourcestring
dlgCppInline = 'C++ styled INLINE';
dlgCMacro = 'C style macros (global)';
dlgInitDoneOnly = 'Constructor name must be ''' + 'init' + ''' (destructor must be ''' + 'done' + ''')';
dlgStaticKeyword = 'Static keyword in objects';
dlgPointerTypeCheck = '@<pointer> returns a typed pointer';
dlgCOAnsiStr = 'Use Ansistrings';
dlgCOUnitStyle = 'Unit style';
dlgCOSmartLinkable = 'Smart linkable';