How to remove verbose compiler output

classic Classic list List threaded Threaded
24 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: How to remove verbose compiler output

Tomas Hajny-2
On Sun, April 6, 2014 02:59, Graeme Geldenhuys wrote:


Hi Graeme,

>> file). This is just to check if the behaviour depends on the compiled
>> sources in any way.
>
> You were on to something. Using your simple unit as an example, all the
> various -v options work perfectly.
 .
 .
> So there was no FPC bug after all, but maybe the documentation for
> $HINTS could be extended in this regards - stating that it doesn't
> restore the previous verbosity level, it sets a new one. It could be
> helpful to other developers in future.
 .
 .

I'm glad that we managed to resolve the mystery finally. :-) Regarding
restoring the previous status for showing hints - do you mean {$HINTS
DEFAULT}?

Tomas


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: How to remove verbose compiler output

Sven Barth-2
In reply to this post by Graeme Geldenhuys-6

Am 06.04.2014 12:42 schrieb "Graeme Geldenhuys" <[hidden email]>:
> My usage of the $HINTS directive was to switch hints off for one or more
> lines of code, then switch hints back on. An example of this would be
> around the FillChar() call.

I wrote you that already some time ago: to be on the safe side you should use the following:

=== code begin ===

{$push}
{$hints off}
// code with disabled hints
{$pop}

=== code end ===

Pop will restore the state that it was at the Push directive.

Just in case: not Delphi compatible.

Regards,
Sven


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: How to remove verbose compiler output

Graeme Geldenhuys-6
On 2014-04-06 13:41, Sven Barth wrote:
>
> Pop will restore the state that it was at the Push directive.

My appologies, I completely forgot about that. Thanks for reminding me.
I've made a note in my offline documentation so as not to forget this
tip again.


> Just in case: not Delphi compatible.

In this case I can't use it, because this project must stay Delphi
compatible. Still a very useful tip though. Thanks again.


Regards,
  - Graeme -

--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: How to remove verbose compiler output

Marco van de Voort
In our previous episode, Graeme Geldenhuys said:
> > Just in case: not Delphi compatible.
>
> In this case I can't use it, because this project must stay Delphi
> compatible. Still a very useful tip though. Thanks again.

Then you must test with $ifopt, set a define if it is enabled, and then
restore it if the define is set afterwards and undef the define.

It is more verbose but it works, something like:

{$undef something}
{$ifopt hints } // don't know exact syntax}
  {$define something}
{$endif}
{$hints on}

.... code

{$ifndef something}
  {$hints off}
{$endif}

Problem is that this construct doesn't nest, and gets really complicated for
multiple settings.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
12