[fpc-pascal] Hack for C-like macro functions — will it work in future?

Philippe philippe at quarta.com.br
Wed Sep 24 12:12:44 CEST 2014


 

-OoREMOVEEMPTYPROCS 

interesting! 

why is it not available in
Lazarus through "all options" window (in project options / customizable
options)? 

(not sure about the names ... I have "opções personalizadas"
and "todas as opções"!) 

Philippe 

Em 24.09.2014 06:17, Sven Barth
escreveu: 

> Am 24.09.2014 10:15 schrieb "Tomas Hajny"
<XHajT03 at hajny.biz>:
> > However, the trunk compiler offers also another
option, although it may or
> > may not be usable for you. In particular,
take the following:
> >
> > ---------
> > var
> > S2: string;
> >
> >
procedure Log (S: string);
> > begin
> > {$IFDEF TEST}
> > WriteLn
(S);
> > {$ENDIF TEST}
> > end;
> >
> > begin
> > ReadLn (S2);
> > Log
('Input = ' + S2);
> > end.
> > =========
> >
> > If this is compiled
with trunk compiler using -OoREMOVEEMPTYPROCS (without
> > -dTEST),
procedure Log is not called at all and the concatenation of
> > strings
in its parameter is skipped as well. 
> 
> Another possibility would be
to define Log() as "inline", which should get rid of the call and maybe
the concatenation as well and already works in 2.6.x (though "array of
const" would not be supported if needed) 
> 
> Regards,
> Sven 
> 
>
_______________________________________________
> fpc-pascal maillist -
fpc-pascal at lists.freepascal.org
>
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal [1]




Links:
------
[1]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20140924/78517f81/attachment.html>


More information about the fpc-pascal mailing list