View Issue Details

IDProjectCategoryView StatusLast Update
0025946FPCCompilerpublic2014-04-23 08:20
ReporterstockiAssigned ToJonas Maebe 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionno change required 
Product Version2.7.1Product Build 
Target VersionFixed in Version 
Summary0025946: Compiler switch -v0 does not work
Description-v0 means verbose nothing. But I can see hints, warnings etc.....
TagsNo tags attached.
Fixed in Revision
FPCOldBugId
FPCTarget
Attached Files

Activities

Graeme Geldenhuys

2014-04-05 15:05

reporter   ~0074160

I can confirm this bug. I was testing under 64-bit FreeBSD using FPC 2.6.2

Here is a discussion about what I tried.
  http://lists.freepascal.org/pipermail/fpc-pascal/2014-April/041515.html

stocki

2014-04-05 15:33

reporter   ~0074161

All -v switches are broken.

Jonas Maebe

2014-04-05 17:30

manager   ~0074164

> All -v switches are broken.

Maybe for some people in certain circumstances, but in the general case that is definitely not true:

$ cat tt.pp
var
  a: longint;
  b: string;
begin
  a:=b;
end.

$ ppn5 tt -l-
Target OS: Darwin for i386
Compiling tt.pp
tt.pp(5,6) Warning: Variable "b" does not seem to be initialized
tt.pp(5,6) Error: Incompatible types: got "ShortString" expected "LongInt"
tt.pp(7) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted

$ ppn5 tt -l- -v0
tt.pp(5,6) Error: Incompatible types: got "ShortString" expected "LongInt"
tt.pp(7) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted

(note that -v0 is supposed to disable all messages *except* for errors)

$ ppn5 tt -l- -ve-
Target OS: Darwin for i386
Compiling tt.pp
tt.pp(5,6) Warning: Variable "b" does not seem to be initialized
tt.pp(7) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted

$ ppn5 tt -l- -ve- -vw-
Target OS: Darwin for i386
Compiling tt.pp
tt.pp(7) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted

Tomas Hajny

2014-04-05 22:06

manager   ~0074166

Can you (stocki) please add information about the platform you used? Do you observe the same behaviour if you add option -n to the compiler command line? Does it happen for even the simplest source files like the one included by Jonas above, or does it depend on the compiled source in any way?

stocki

2014-04-05 23:36

reporter   ~0074168

I used the 2.7.1 fpc win32 snapshot. At the moment, I have no fpc available on this pc.

Graeme Geldenhuys

2014-04-06 03:06

reporter   ~0074170

@stocki
Double check that none of the code you compile has the directive {$HINTS ON} - if you do, that sets a new verbosity level (equivalent of -vewhin), thus overriding the -v parameters you might have specific in fpc.cfg or on the command line.

With lots of testing I found that that was the cause of my problem. My work-around, to silence the compiler messages, was to specify -vm and a list of message numbers to suppress.

The {$HINTS ON} doesn't restore the previous verbosity level, it sets a new one. Maybe FPC could be improve one day to save/restore the verbose state instead.

stocki

2014-04-06 16:50

reporter   ~0074174

I have an include file in with hints on, that overrules the command line switches. Is that overrule intended?

Tomas Hajny

2014-04-06 20:05

manager   ~0074178

Yes, that is certainly intended. If someone changes compiler options in his source code, it's assumed that they are necessary or at least most appropriate for this specific source code and thus this setting has the highest priority.

Graeme Geldenhuys

2014-04-06 21:25

reporter   ~0074181

@stocki
Yes, that is intended. If you only want to disable/enable hints around specific code, don't include it in the include file, but rather wrap your related source code. Sven Barth reminded me of a tip he mentioned to me before. There is a "stack" option for {$HINTS} and it works as follows

-------------[ forwarded email ]---------------------
=== 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.
-----------------[ end ]----------------------

Hope this helps.

Issue History

Date Modified Username Field Change
2014-03-29 12:41 stocki New Issue
2014-04-05 15:05 Graeme Geldenhuys Note Added: 0074160
2014-04-05 15:33 stocki Note Added: 0074161
2014-04-05 17:30 Jonas Maebe Note Added: 0074164
2014-04-05 22:06 Tomas Hajny Note Added: 0074166
2014-04-05 23:36 stocki Note Added: 0074168
2014-04-06 03:06 Graeme Geldenhuys Note Added: 0074170
2014-04-06 16:50 stocki Note Added: 0074174
2014-04-06 20:05 Tomas Hajny Note Added: 0074178
2014-04-06 21:25 Graeme Geldenhuys Note Added: 0074181
2014-04-07 13:38 Jonas Maebe Status new => resolved
2014-04-07 13:38 Jonas Maebe Resolution open => no change required
2014-04-07 13:38 Jonas Maebe Assigned To => Jonas Maebe
2014-04-23 08:20 stocki Status resolved => closed