[Lazarus] -WG compiler parameter issue in cross-platform projects

Florian Klämpfl florian at freepascal.org
Thu Jul 14 19:07:21 CEST 2011


Am 14.07.2011 14:04, schrieb Sven Barth:
> Am 14.07.2011 11:43, schrieb Graeme Geldenhuys:
>>> Although I still think this is a bug in FPC.
>>
>> +1  What is the point of 'cross-platform support' then? Letting the
>> compiler simply ignore parameters that ain't relevant for the target
>> seems a rather simple solution - at it worked like that for years.
>> Except now.
> 
> I'm quoting Florian's answer from the before mentioned thread "Illegal
> paramater: -WG" from around 7th June this year:
> 
> === quote begin ===
> 
> Maybe it's worse to check all the -W switches in lazarus. I made them
> all target dependent.
> 
> === quote end ===
> 
> So it seems that it was a concsious decision by Florian. For the "why"
> you need to ask him though ^^

Pretty simple: most target specific switches were never silently ignored
if they didn't apply to the current target. A arm compiler complains
also about a -Oppentium. -WG was one of the few examples of the group of
the -W switches which was silently ignored, probably due to historic
reasons.

Further, fpc is a pascal compiler, it tries to prevent people to shoot
themself into the foot. And to ignore silently command line switches if
they don't apply is imo very bad practive. Last but not least, fpc
provides enough means to do this properly by using ifdef in
configuration files or using the apptype directive. And I'am pretty
sure, lazarus will offer a good solution as well to do this properly.




More information about the Lazarus mailing list