How to remove verbose compiler output

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

How to remove verbose compiler output

Graeme Geldenhuys-6
Hi,

I'm trying to reduce the compiler output for cron jobs.

I have tried to specify -v0  or even  -v- -v0   but still the compiler
outputs loads of 'Hint' and 'Warning' message about unused parameters,
unused units, deprecated methods etc.

I made sure no -v is specified in my ~.fpc.cfg as well, but still the
compiler seems to ignore my -v0 preference on the command line.

What else can I try?

I'm using FPC 2.6.2 under FreeBSD.

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

Henry Vermaak
On Fri, Apr 04, 2014 at 04:03:10AM +0100, Graeme Geldenhuys wrote:

> Hi,
>
> I'm trying to reduce the compiler output for cron jobs.
>
> I have tried to specify -v0  or even  -v- -v0   but still the compiler
> outputs loads of 'Hint' and 'Warning' message about unused parameters,
> unused units, deprecated methods etc.
>
> I made sure no -v is specified in my ~.fpc.cfg as well, but still the
> compiler seems to ignore my -v0 preference on the command line.

I use -vi-n-h- for my release builds, which removes info, notes and
hints, otherwise it becomes hard to see the wood from the trees!

Henry
_______________________________________________
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

Tomas Hajny-2
In reply to this post by Graeme Geldenhuys-6
On Fri, April 4, 2014 05:03, Graeme Geldenhuys wrote:

> Hi,
>
> I'm trying to reduce the compiler output for cron jobs.
>
> I have tried to specify -v0  or even  -v- -v0   but still the compiler
> outputs loads of 'Hint' and 'Warning' message about unused parameters,
> unused units, deprecated methods etc.
>
> I made sure no -v is specified in my ~.fpc.cfg as well, but still the
> compiler seems to ignore my -v0 preference on the command line.
>
> What else can I try?
>
> I'm using FPC 2.6.2 under FreeBSD.

Well, I can remove all output altogether by using -v0 and -l- (tested with
both 2.6.2 and 2.6.4 under Win32; I don't think that the platform should
matter much here).

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

Graeme Geldenhuys-6
In reply to this post by Henry Vermaak
On 2014-04-04 15:32, Henry Vermaak wrote:
>
> I use -vi-n-h- for my release builds, which removes info, notes and
> hints, otherwise it becomes hard to see the wood from the trees!

Exactly what I want to try and do, but it seems FPC is really stubborn
under FreeBSD. I tried the exact same -v parameters as you suggested,
but it made no difference. :-/

Here is my build script.

------------[ build-64.sh ]-----------------
#!/bin/sh
# Build script for tiOPF using 64bit Free Pascal Compiler
BASEDIR="/data/devel"
FPC="$BASEDIR/fpc-2.6.2/x86_64-freebsd/bin/ppcx64"
FPCVER=`$FPC -iV`
FPCCPU=`$FPC -iTP`
FPCHOST=`$FPC -iTO`
TIOPF="$BASEDIR/tiopf_dailybuilds/tiopf"
FBLIB="$TIOPF/3rdParty/FBLib"
ZEOS="$BASEDIR/opensource/zeos_svn"

$FPC -MObjFPC -S2cai -O1 -gl -vi-n-h- -B \
  -Fu$FBLIB \
  -Fi$FBLIB \
    -Fu$ZEOS/src/core \
    -Fu$ZEOS/src/component \
    -Fu$ZEOS/src/dbc \
    -Fu$ZEOS/src/parsesql \
    -Fu$ZEOS/src/plain \
    -Fu$ZEOS/packages/lazarus/ \
  -Fi$TIOPF/Core/ \
  -Fu$TIOPF/Core/ \
  -Fu$TIOPF/Options/ \
  -Fu$TIOPF/GUI/ \
  -FU$TIOPF/Compilers/FPC/lib/$FPCCPU-$FPCHOST/ \
  -dLINK_CSV -dLINK_TAB -dLINK_XMLLIGHT -dLINK_SQLDB_IB \
  -dLINK_FBL -dLINK_ZEOS_FB -dLINK_ZEOS_MYSQL50 \
  -dUseCThreads \
  $TIOPF/Compilers/FPC/tiOPF.pas

----------------[ end ]------------------


And this is the output it generates..... Lots of noise!

------------------------------------------------
[freebsd (tiopf2)]$ ./build-64.run
Free Pascal Compiler version 2.6.2 [2013/02/10] for x86_64
Copyright (c) 1993-2012 by Florian Klaempfl and others
tiUtils.pas(3000,3) Hint: Local const "subdomain_chars" is not used
tiUtils.pas(3261,43) Hint: Local variable "LBytes1" does not seem to be
initialized
tiUtils.pas(3262,43) Hint: Local variable "LBytes2" does not seem to be
initialized
tiCompress.pas(103,45) Hint: Function result variable does not seem to
be initialized
tiCompress.pas(115,47) Hint: Function result variable does not seem to
be initialized
tiBase64.pas(246,37) Hint: Local variable "scanBuf" does not seem to be
initialized
tiBase64.pas(273,27) Hint: Local variable "endBytes" does not seem to be
initialized
tiBase64.pas(346,33) Hint: Local variable "ReadBuf" does not seem to be
initialized
tiBase64.pas(95,19) Hint: Parameter "Offset" not used
tiBase64.pas(95,36) Hint: Parameter "Origin" not used
tiStreams.pas(571,44) Hint: Local variable "InputBuffer" does not seem
to be initialized
tiStreams.pas(646,20) Hint: Conversion between ordinals and pointers is
not portable
tiStreams.pas(646,88) Hint: Conversion between ordinals and pointers is
not portable
tiStreams.pas(764,37) Hint: Conversion between ordinals and pointers is
not portable
tiStreams.pas(332,3) Hint: Local const "MIME_BUFFER_SIZE" is not used
tiLog.pas(284,43) Hint: Parameter "ASeverity" not used
tiLog.pas(293,45) Hint: Parameter "ARaiseException" not used
tiLog.pas(294,50) Hint: Parameter "ARaiseException" not used
tiLog.pas(779,26) Hint: Conversion between ordinals and pointers is not
portable
tiLog.pas(137,33) Hint: Parameter "ADateTime" not used
tiLog.pas(138,34) Hint: Parameter "AMessage" not used
tiPool.pas(119,3) Hint: Local const "CMaxPoolSize" is not used
tiPool.pas(120,3) Hint: Local const "CMinPoolSize" is not used

....snip....

tiOPF.pas(18,3) Hint: Unit "tiFilteredObjectList" not used in tiOPF
tiOPF.pas(18,41) Hint: Unit "tiModelMediator" not used in tiOPF
tiOPF.pas(18,58) Hint: Unit "tiQueryDataset" not used in tiOPF
tiOPF.pas(18,74) Hint: Unit "tiOPFSqlScript" not used in tiOPF
tiOPF.pas(19,15) Hint: Unit "tiLogToDebugSvr" not used in tiOPF
tiOPF.pas(19,32) Hint: Unit "tiPersistenceLayers" not used in tiOPF
tiOPF.pas(19,53) Hint: Unit "tiWebServerClientConnectionDetails" not
used in tiOPF
tiOPF.pas(20,3) Hint: Unit "tiCRC32" not used in tiOPF

-------------------------------------------------


This is frustrating as hell. :)


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

Michael Van Canneyt


On Fri, 4 Apr 2014, Graeme Geldenhuys wrote:

> On 2014-04-04 15:32, Henry Vermaak wrote:
>>
>> I use -vi-n-h- for my release builds, which removes info, notes and
>> hints, otherwise it becomes hard to see the wood from the trees!
>
> Exactly what I want to try and do, but it seems FPC is really stubborn
> under FreeBSD. I tried the exact same -v parameters as you suggested,
> but it made no difference. :-/

Some random ideas:

maybe it's loading some config file anyway.
Do a strace and see if it opens a config file.

secondly: There is no {$HINTS ON} or so in the sources ?

Michael.
_______________________________________________
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-05 11:48, Michael Van Canneyt wrote:
>
> maybe it's loading some config file anyway.
> Do a strace and see if it opens a config file.

'strace' is not available/supported by 64-bit FreeBSD (only 32-bit
FreeBSD). But I did remember that FPC has a very verbose output option.
Amazingly that -v parameter did make FPC output more details - so at
least FPC does seem to read my -v options (at least some of them).

Here is a very small snippet of what I got from using the -vav parameter.

...snip...
[0.000] Macro defined: CPUAMD64
[0.000] Macro defined: CPU64
[0.000] Configfile search: /home/graemeg/.fpc.cfg
[0.000] Reading options from file /home/graemeg/.fpc.cfg
[0.000] Start of reading config file /home/graemeg/.fpc.cfg
[0.000] interpreting file option "#"
[0.000] interpreting file option "# Example fpc.cfg for Free Pascal
Compiler"
...snip...

That is the only config file it found and loaded. That config file
contains a -v- option, but even removing that option completely makes no
difference.

Could this be a bug in the FreeBSD version of FPC? That some of the -v
options simply don't work under FreeBSD?

Could somebody else with FreeBSD access test the -v parameter? That way
we can confirm if it is something odd on my system (and I'll keep
searching), or a general FPC issue.



> secondly: There is no {$HINTS ON} or so in the sources ?

I never use that option inside units. But to made double sure, I just
did a search, and can confirm no such directive exists in any of the
source code I'm trying to compile.



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

Jonas Maebe-2
On 05/04/14 13:29, Graeme Geldenhuys wrote:
> That is the only config file it found and loaded. That config file
> contains a -v- option, but even removing that option completely makes no
> difference.

-v- doesn't do anything, it's -v0 that should switch off all output
(except for errors and fatal errors). Someone else reported the same bug
very recently though (http://bugs.freepascal.org/view.php?id=25946 ), so
you're not the only one experiencing this.


Jonas
_______________________________________________
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

Pierre Muller
In reply to this post by Graeme Geldenhuys-6
  Hi Graeme,

  maybe you should do a
a
$FPC -va -h | grep "Reading options from"
and check which configuration file is loaded.
 
  But anyhow, the option unit contains code that
normally ensure that command line options always
win over config file options.
  However, Michael is right in asking about {$hints on}
inside source, because, in such case
the command line -v0 has no effect.

Pierre Muller


> -----Message d'origine-----
> De : [hidden email] [mailto:fpc-pascal-
> [hidden email]] De la part de Graeme Geldenhuys
> Envoyé : vendredi 4 avril 2014 19:42
> À : [hidden email]
> Objet : Re: [fpc-pascal] How to remove verbose compiler output
>
> On 2014-04-04 15:32, Henry Vermaak wrote:
> >
> > I use -vi-n-h- for my release builds, which removes info, notes and
> > hints, otherwise it becomes hard to see the wood from the trees!
>
> Exactly what I want to try and do, but it seems FPC is really stubborn
> under FreeBSD. I tried the exact same -v parameters as you suggested,
> but it made no difference. :-/
>
> Here is my build script.
>
> ------------[ build-64.sh ]-----------------
> #!/bin/sh
> # Build script for tiOPF using 64bit Free Pascal Compiler
> BASEDIR="/data/devel"
> FPC="$BASEDIR/fpc-2.6.2/x86_64-freebsd/bin/ppcx64"
> FPCVER=`$FPC -iV`
> FPCCPU=`$FPC -iTP`
> FPCHOST=`$FPC -iTO`
> TIOPF="$BASEDIR/tiopf_dailybuilds/tiopf"
> FBLIB="$TIOPF/3rdParty/FBLib"
> ZEOS="$BASEDIR/opensource/zeos_svn"
>
> $FPC -MObjFPC -S2cai -O1 -gl -vi-n-h- -B \
>   -Fu$FBLIB \
>   -Fi$FBLIB \
>     -Fu$ZEOS/src/core \
>     -Fu$ZEOS/src/component \
>     -Fu$ZEOS/src/dbc \
>     -Fu$ZEOS/src/parsesql \
>     -Fu$ZEOS/src/plain \
>     -Fu$ZEOS/packages/lazarus/ \
>   -Fi$TIOPF/Core/ \
>   -Fu$TIOPF/Core/ \
>   -Fu$TIOPF/Options/ \
>   -Fu$TIOPF/GUI/ \
>   -FU$TIOPF/Compilers/FPC/lib/$FPCCPU-$FPCHOST/ \
>   -dLINK_CSV -dLINK_TAB -dLINK_XMLLIGHT -dLINK_SQLDB_IB \
>   -dLINK_FBL -dLINK_ZEOS_FB -dLINK_ZEOS_MYSQL50 \
>   -dUseCThreads \
>   $TIOPF/Compilers/FPC/tiOPF.pas
>
> ----------------[ end ]------------------
>
>
> And this is the output it generates..... Lots of noise!
>
> ------------------------------------------------
> [freebsd (tiopf2)]$ ./build-64.run
> Free Pascal Compiler version 2.6.2 [2013/02/10] for x86_64
> Copyright (c) 1993-2012 by Florian Klaempfl and others
> tiUtils.pas(3000,3) Hint: Local const "subdomain_chars" is not used
> tiUtils.pas(3261,43) Hint: Local variable "LBytes1" does not seem to be
> initialized
> tiUtils.pas(3262,43) Hint: Local variable "LBytes2" does not seem to be
> initialized
> tiCompress.pas(103,45) Hint: Function result variable does not seem to
> be initialized
> tiCompress.pas(115,47) Hint: Function result variable does not seem to
> be initialized
> tiBase64.pas(246,37) Hint: Local variable "scanBuf" does not seem to be
> initialized
> tiBase64.pas(273,27) Hint: Local variable "endBytes" does not seem to
> be
> initialized
> tiBase64.pas(346,33) Hint: Local variable "ReadBuf" does not seem to be
> initialized
> tiBase64.pas(95,19) Hint: Parameter "Offset" not used
> tiBase64.pas(95,36) Hint: Parameter "Origin" not used
> tiStreams.pas(571,44) Hint: Local variable "InputBuffer" does not seem
> to be initialized
> tiStreams.pas(646,20) Hint: Conversion between ordinals and pointers is
> not portable
> tiStreams.pas(646,88) Hint: Conversion between ordinals and pointers is
> not portable
> tiStreams.pas(764,37) Hint: Conversion between ordinals and pointers is
> not portable
> tiStreams.pas(332,3) Hint: Local const "MIME_BUFFER_SIZE" is not used
> tiLog.pas(284,43) Hint: Parameter "ASeverity" not used
> tiLog.pas(293,45) Hint: Parameter "ARaiseException" not used
> tiLog.pas(294,50) Hint: Parameter "ARaiseException" not used
> tiLog.pas(779,26) Hint: Conversion between ordinals and pointers is not
> portable
> tiLog.pas(137,33) Hint: Parameter "ADateTime" not used
> tiLog.pas(138,34) Hint: Parameter "AMessage" not used
> tiPool.pas(119,3) Hint: Local const "CMaxPoolSize" is not used
> tiPool.pas(120,3) Hint: Local const "CMinPoolSize" is not used
>
> ....snip....
>
> tiOPF.pas(18,3) Hint: Unit "tiFilteredObjectList" not used in tiOPF
> tiOPF.pas(18,41) Hint: Unit "tiModelMediator" not used in tiOPF
> tiOPF.pas(18,58) Hint: Unit "tiQueryDataset" not used in tiOPF
> tiOPF.pas(18,74) Hint: Unit "tiOPFSqlScript" not used in tiOPF
> tiOPF.pas(19,15) Hint: Unit "tiLogToDebugSvr" not used in tiOPF
> tiOPF.pas(19,32) Hint: Unit "tiPersistenceLayers" not used in tiOPF
> tiOPF.pas(19,53) Hint: Unit "tiWebServerClientConnectionDetails" not
> used in tiOPF
> tiOPF.pas(20,3) Hint: Unit "tiCRC32" not used in tiOPF
>
> -------------------------------------------------
>
>
> This is frustrating as hell. :)
>
>
> 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
_______________________________________________
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 reply to this post by Graeme Geldenhuys-6
In our previous episode, Graeme Geldenhuys said:
> > maybe it's loading some config file anyway.
> > Do a strace and see if it opens a config file.
>
> 'strace' is not available/supported by 64-bit FreeBSD (only 32-bit
> FreeBSD).

That's because it is a port.  The normal tool to use on BSDs is ktrace. (and
on some other SYSV derived systems, like Solaris, it is called truss IIRC)

But I did remember that FPC has a very verbose output option.
>
> Could this be a bug in the FreeBSD version of FPC? That some of the -v
> options simply don't work under FreeBSD?

I doubt it, filtering log output isn't really platform dependent.
_______________________________________________
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
In reply to this post by Jonas Maebe-2
On 2014-04-05 13:07, Jonas Maebe wrote:
>
> -v- doesn't do anything, it's -v0 that should switch off all output
> (except for errors and fatal errors).

Thanks. So what is the difference between -ve and -v0? From the compiler
help output it sounds like they do the same thing. But neither of them
works in my case.

  -v<x>  Be verbose. <x> is a combination of the following letters:
      e : Show errors (default)       0 : Show nothing (except errors)


> Someone else reported the same bug
> very recently though (http://bugs.freepascal.org/view.php?id=25946 ), so
> you're not the only one experiencing this.

Okay. I added a comment and a link to this discussion.


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

Graeme Geldenhuys-6
In reply to this post by Marco van de Voort
On 2014-04-05 13:36, Marco van de Voort wrote:
> I doubt it, filtering log output isn't really platform dependent.


That is what I assume too. So the issue is probably across all platforms
then (but I haven't tested elsewhere yet).


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

Graeme Geldenhuys-6
In reply to this post by Pierre Muller
On 2014-04-05 13:09, Pierre Free Pascal wrote:
> $FPC -va -h | grep "Reading options from"
> and check which configuration file is loaded.

That is pretty much what I did...

----------------------
[freebsd (tiopf2)]$ fpc -va -h | grep "Reading options from"
[0.000] Reading options from file /home/graemeg/.fpc.cfg
[freebsd (tiopf2)]$
----------------------


> However, Michael is right in asking about {$hints on}

Like is said in my reply to Michael, I searched through all related
code, and there is no such directive used.


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

Jonas Maebe-2
In reply to this post by Graeme Geldenhuys-6
On 05/04/14 15:11, Graeme Geldenhuys wrote:
> On 2014-04-05 13:07, Jonas Maebe wrote:
>> >
>> >-v- doesn't do anything, it's -v0 that should switch off all output
>> >(except for errors and fatal errors).
> Thanks. So what is the difference between -ve and -v0?

-ve does not switch anything off, it only enables showing errors (e.g.,
if it was disabled first via -ve-). -v0 switches off everything but
error reporting.


Jonas
_______________________________________________
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

Michael Van Canneyt


On Sat, 5 Apr 2014, Jonas Maebe wrote:

> On 05/04/14 15:11, Graeme Geldenhuys wrote:
>> On 2014-04-05 13:07, Jonas Maebe wrote:
>>> >
>>> >-v- doesn't do anything, it's -v0 that should switch off all output
>>> >(except for errors and fatal errors).
>> Thanks. So what is the difference between -ve and -v0?
>
> -ve does not switch anything off, it only enables showing errors (e.g., if it
> was disabled first via -ve-). -v0 switches off everything but error
> reporting.

...Supposedly, in view of the bugreport and trouble experienced by Graeme ;)

That said, I find it strange, because I have all verbosity except errors switched off,
and it works.

Michael.
_______________________________________________
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
On 05.04.2014 15:18, Graeme Geldenhuys wrote:

> On 2014-04-05 13:09, Pierre Free Pascal wrote:
>> $FPC -va -h | grep "Reading options from"
>> and check which configuration file is loaded.
>
> That is pretty much what I did...
>
> ----------------------
> [freebsd (tiopf2)]$ fpc -va -h | grep "Reading options from"
> [0.000] Reading options from file /home/graemeg/.fpc.cfg
> [freebsd (tiopf2)]$
> ----------------------

Could you test by disabling the usage of a config file (-n)? You'll need
to pass all paths using -Fu then, so I suggest to use a simple test
project which prints hints, etc. without "-n" and then test that with "-n".

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
In reply to this post by Jonas Maebe-2
On 2014-04-05 16:23, Jonas Maebe wrote:
>
> -ve does not switch anything off, it only enables showing errors

Ah, now I understand. Thanks for the info.

For an immediate solution (work-around), I enabled message numbers
(-vq), and then created a long list of -vm[x],[y] options to suppress
the messages I wanted to hide in the first place. This has worked.

So it seems at least some of the -v options are working, but definitely
not all of them.


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

Graeme Geldenhuys-6
In reply to this post by Sven Barth-2
On 2014-04-05 17:00, Sven Barth wrote:
>
> Could you test by disabling the usage of a config file (-n)? You'll need
> to pass all paths using -Fu then,

No problem. Just did the test with -n and it made no difference when it
comes to the -v parameter options. The -vh- , -vw- and -v0 parameters
are all ignored. I still get the usual verbose output.

Here is my build script as I used it for this test.

----8<-------------8<-------------8<-------------8<-------------8<----
#!/bin/sh
# Build script for tiOPF using 64bit Free Pascal Compiler
BASEDIR="/data/devel"
FPC="$BASEDIR/fpc-2.6.2/x86_64-freebsd/bin/ppcx64"
FPCVER=`$FPC -iV`
FPCCPU=`$FPC -iTP`
FPCHOST=`$FPC -iTO`
TIOPF="$BASEDIR/tiopf_dailybuilds/tiopf"
FBLIB="$TIOPF/3rdParty/FBLib"
ZEOS="$BASEDIR/opensource/zeos_svn"

# set variables as they would have been in fpc.cfg
fpcversion="2.6.2"
fpctarget="x86_64-freebsd"

# Work-around to suppress all unwanted messages
#$FPC -MObjFPC -S2cai -O1 -gl -vh- -vw- -ve -vq
-vm5023,505#7,5058,5060,5024,5028,4055 -B \

$FPC -MObjFPC -S2cai -O1 -gl -vh- -vw- -v0 -n -B \

-Fu/data/devel/fpc-$fpcversion/$fpctarget/lib/fpc/$fpcversion/units/$fpctarget/*
\
  -Fl/lib:/usr/lib:/usr/local/lib \
  -Fl/data/devel/fpc-$fpcversion/lib/fpc/$fpcversion/lib/$fpctarget \
  -FD/data/devel/fpc-$fpcversion/$fpctarget/bin/ \
   -Fu$FBLIB \
   -Fi$FBLIB \
    -Fu$ZEOS/src/core \
    -Fu$ZEOS/src/component \
    -Fu$ZEOS/src/dbc \
    -Fu$ZEOS/src/parsesql \
    -Fu$ZEOS/src/plain \
    -Fu$ZEOS/packages/lazarus/ \
  -Fi$TIOPF/Core/ \
  -Fu$TIOPF/Core/ \
  -Fu$TIOPF/Options/ \
  -Fu$TIOPF/GUI/ \
  -FU$TIOPF/Compilers/FPC/lib/$FPCCPU-$FPCHOST/ \
  -dLINK_CSV -dLINK_TAB -dLINK_XMLLIGHT -dLINK_SQLDB_IB \
  -dLINK_FBLx -dLINK_ZEOS_FB -dLINK_ZEOS_MYSQL50 \
  -dUseCThreads \
  $TIOPF/Compilers/FPC/tiOPF.pas

----8<-------------8<-------------8<-------------8<-------------8<----

And the output is still verbose

-------------------------------------------
[freebsd (tiopf2)]$ ./opf_package-64.run
tiUtils.pas(3000,3) Hint: Local const "subdomain_chars" is not used
tiUtils.pas(3261,43) Hint: Local variable "LBytes1" does not seem to be
initialized
tiUtils.pas(3262,43) Hint: Local variable "LBytes2" does not seem to be
initialized
tiCompress.pas(103,45) Hint: Function result variable does not seem to
be initialized
tiCompress.pas(115,47) Hint: Function result variable does not seem to
be initialized
tiBase64.pas(246,37) Hint: Local variable "scanBuf" does not seem to be
initialized
.....snip.....
tiOPF.pas(19,32) Hint: Unit "tiPersistenceLayers" not used in tiOPF
tiOPF.pas(19,53) Hint: Unit "tiWebServerClientConnectionDetails" not
used in tiOPF
tiOPF.pas(20,3) Hint: Unit "tiCRC32" not used in tiOPF
[freebsd (tiopf2)]$
-------------------------------------------


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

Tomas Hajny-2
In reply to this post by Michael Van Canneyt
On Sat, April 5, 2014 17:26, Michael Van Canneyt wrote:

>
>
> On Sat, 5 Apr 2014, Jonas Maebe wrote:
>
>> On 05/04/14 15:11, Graeme Geldenhuys wrote:
>>> On 2014-04-05 13:07, Jonas Maebe wrote:
>>>> >
>>>> >-v- doesn't do anything, it's -v0 that should switch off all output
>>>> >(except for errors and fatal errors).
>>> Thanks. So what is the difference between -ve and -v0?
>>
>> -ve does not switch anything off, it only enables showing errors (e.g.,
>> if it
>> was disabled first via -ve-). -v0 switches off everything but error
>> reporting.
>
> ...Supposedly, in view of the bugreport and trouble experienced by Graeme
> ;)
>
> That said, I find it strange, because I have all verbosity except errors
> switched off,
> and it works.

As mentioned yesterday, I tested it under Win32 with the 2.6.4 compiler
and it worked according to specification. It apparently works well for
Jonas too on his Mac OS X machine (according to his note added to the bug
report).

We clearly need to find out more information about the differences leading
to the incorrect behaviour. That's why I asked the bug reporter to provide
information about his platform (one difference which I can see that Graeme
uses the x86_64 version - not that it should make any difference, but all
possibilities need to be analyzed), check if -n changes anything and test
if it works the same also with the simplest source files.

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

Tomas Hajny-2
In reply to this post by Graeme Geldenhuys-6
On Sat, April 5, 2014 21:13, Graeme Geldenhuys wrote:
> On 2014-04-05 17:00, Sven Barth wrote:
>>
>> Could you test by disabling the usage of a config file (-n)? You'll need
>> to pass all paths using -Fu then,
>
> No problem. Just did the test with -n and it made no difference when it
> comes to the -v parameter options. The -vh- , -vw- and -v0 parameters
> are all ignored. I still get the usual verbose output.
 .
 .

Graeme, can you please try if you get the same behaviour with simple
source files like the following:

-----------
var
 C: cardinal;
begin
 C := -1;
end.
===========

By default (i.e. with -n and no -v* whatsoever), this should not show
anything. With the default configuration file, it should show one hint (C
assigned but not used) and one warning (range check). With the
configuration file and -v0 it should not show anything again (apart from
the compiler version if you have the default of -l in your configuration
file). This is just to check if the behaviour depends on the compiled
sources in any way.

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

Graeme Geldenhuys-6
Hi Tomas,

On 2014-04-05 23:39, Tomas Hajny wrote:
> 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.

That made me double check the code I'm compiling - then I found
something. When I searched through all the source code [the first time]
for the text '$HINTS ON', my searching tool accidentally had regex
support enabled, thus the $ symbol was interpreted differently, and
resulted in no files with such text found. Doing the search again, and
this time disabling regex support, it revealed that I had a few units
that used the $HINTS directive.

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 checked the FPC 2.6.2 documentation about the $HINTS directive and it
doesn't say what hints get switched on. But from a quick
experimentation, it seems {$HINTS ON} is equivalent to -vewnhi (it
doesn't just restore the previous hint verbosity state, it overrides and
sets a new verbosity state). And knowing now that {$HINTS ON} takes
priority over everything else, it explains the reason why my command
line parameter for -v<whatever> or what was defined in fpc.cfg was
totally useless.

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.

So in the end my only solution is to use -vm with a list of message
numbers I want to suppress.

Thanks to everybody that tried to help me - much appreciated.

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
12