Is it just me or does {$WARN DUPLICATE_CTOR_DTOR OFF} not work in Delphi 10.1 Berlin?

Is it just me or does {$WARN DUPLICATE_CTOR_DTOR OFF} not work in Delphi 10.1 Berlin?

(Back story: Checked out latest mORMot, trying to inter-alia use unit SynCommons.pas in a project that has Project options "Hints and Warnings" -> "Output Warnings" set to "as errors". I've done the obvious which is to set {$WARN DUPLICATE_CTOR_DTOR OFF} but the compiler keeps complaining about duplicate constructor ESynException.CreateLastOSError with identical parameters being inaccessible from C++ regardless. What am I missing? I can make the code compile by changing the "Output Warnings" option but I really don't want to do that.)

Comments

  1. OK I've now turned the specific Warning off in the list of warnings in the Project options but left the default for all the other warnings as "error". This works. It's mildly annoying that the compiler directive in the source code is being ignored.

    ReplyDelete
  2. One of the problems here is that there is no "main" source file in plain readable text format where you can put settings applying to all sources. That's why most 3rd party libraries have an include file with settings that is {$I} in every unit.

    ReplyDelete

Post a Comment