Forum > Options

"Note: passing compiler option -M twice with different values"

(1/2) > >>

creaothceann:
In Lazarus I'm setting the syntax mode (menu | Project | Project Options | Compiler Options | Parsing | Syntax mode) to Free Pascal ("-Mfpc").

In the "Custom Options" I set these: -CfAVX2 -CpCOREAVX2 -Madvancedrecords -Mdefaultparameters -Mout -Mresult

The result is that my project compiles successfully, but in the messages window I get the hint "Note: passing compiler option -M twice with different values". Do I just disable that hint (somehow)?

Thausand:

--- Quote from: creaothceann on April 07, 2019, 07:34:47 pm ---In the "Custom Options" I set these: -CfAVX2 -CpCOREAVX2 -Madvancedrecords -Mdefaultparameters -Mout -Mresult

The result is that my project compiles successfully, but in the messages window I get the hint "Note: passing compiler option -M twice with different values". Do I just disable that hint (somehow)?

--- End quote ---
Not must disable !!! you make error.

-M only for language mode. No for mode switch.

add:
option command line -M write help here https://www.freepascal.org/docs-html/user/userap1.html

--- Code: ----M<x>  Set language mode to <x> 
      -Mfpc      Free Pascal dialect (default) 
      -Mobjfpc   FPC mode with Object Pascal support 
      -Mdelphi   Delphi 7 compatibility mode 
      -Mtp       TP/BP 7.0 compatibility mode 
      -Mmacpas   Macintosh Pascal dialects compatibility mode 
      -Miso      ISO 7185 mode 
      -Mextendedpascal ISO 10206 mode 
      -Mdelphiunicode Delphi 2009 and later compatibility mode

--- End code ---

$MODESWITCH write help here https://www.freepascal.org/docs-html/prog/progsu105.html#x113-1140001.3.22

--- Code: ---{$MODESWITCH XXX} 
{$MODESWITCH XXX+} 
{$MODESWITCH XXX-}

--- End code ---
can make in program source or unit

creaothceann:
I thought I read somewhere that I can enable features like that, though I can't seem to find it again...

So, then how come I can compile my code when these options are passed to the compiler, but can't when I leave them out? I've added the project as an attachment.

Thausand:

--- Quote from: creaothceann on April 07, 2019, 08:33:09 pm ---I thought I read somewhere that I can enable features like that, though I can't seem to find it again...

--- End quote ---
Sorry, i try and not seem to find. If you see then please write.


--- Quote ---So, then how come I can compile my code when these options are passed to the compiler, but can't when I leave them out? I've added the project as an attachment.

--- End quote ---
Because i wrong and you right  :)


--- Code: ---[0.070] Handling option "-MOBJFPC"
[0.070] interpreting option "-MOBJFPC"
[0.070] Macro defined: FPC_OBJFPC
[0.070] Handling option "-MADVANCEDRECORDS"
[0.070] interpreting option "-MADVANCEDRECORDS"

--- End code ---

Note important . other way:

--- Code: ---[0.055] Handling option "-MADVANCEDRECORDS"
[0.055] interpreting option "-MADVANCEDRECORDS"
[0.055] Handling option "-MOBJFPC"
[0.055] interpreting option "-MOBJFPC"
[0.055] Macro defined: FPC_OBJFPC

2.359] Searching file Test_BTB_History.lpr... found
[2.359] (TEST_BTB_HISTORY) Load from TEST_BTB_HISTORY (implementation) unit U_TOOLS
[2.359] Test_BTB_History.lpr(19,1) (TEST_BTB_HISTORY) Parsing implementation of Test_BTB_History.lpr
[2.359] Test_BTB_History.lpr(23,3) Fatal: Syntax error, "identifier" expected but "TYPE" found
[2.477] Fatal: Compilation aborted

--- End code ---
Order important.

I not know this possible. Thank you for learn me.

creaothceann:

--- Quote from: Thausand on April 07, 2019, 09:06:36 pm ---
--- Quote from: creaothceann on April 07, 2019, 08:33:09 pm ---I thought I read somewhere that I can enable features like that, though I can't seem to find it again...

--- End quote ---
Sorry, i try and not seem to find. If you see then please write.

--- End quote ---
-Mresult was mentioned on this page: http://wiki.freepascal.org/User_Changes_2.6.0


--- Quote from: Thausand on April 07, 2019, 09:06:36 pm ---
--- Code: ---[0.070] Handling option "-MOBJFPC"
[0.070] interpreting option "-MOBJFPC"
[0.070] Macro defined: FPC_OBJFPC
[0.070] Handling option "-MADVANCEDRECORDS"
[0.070] interpreting option "-MADVANCEDRECORDS"

--- End code ---

Note important . other way:

--- Code: ---[0.055] Handling option "-MADVANCEDRECORDS"
[0.055] interpreting option "-MADVANCEDRECORDS"
[0.055] Handling option "-MOBJFPC"
[0.055] interpreting option "-MOBJFPC"
[0.055] Macro defined: FPC_OBJFPC

[2.359] Searching file Test_BTB_History.lpr... found
[2.359] (TEST_BTB_HISTORY) Load from TEST_BTB_HISTORY (implementation) unit U_TOOLS
[2.359] Test_BTB_History.lpr(19,1) (TEST_BTB_HISTORY) Parsing implementation of Test_BTB_History.lpr
[2.359] Test_BTB_History.lpr(23,3) Fatal: Syntax error, "identifier" expected but "TYPE" found
[2.477] Fatal: Compilation aborted

--- End code ---
Order important.

--- End quote ---

I don't really understand these lines... does the compiler automatically define a macro "FPC_OBJFPC" when it encounters these options? I don't have an option "-MOBJFPC" defined, as far as I know the compiler gets "-Mfpc".

Navigation

[0] Message Index

[#] Next page

Go to full version