Recent

Author Topic: Configuring hints and warnings in the IDE messages panel  (Read 1067 times)

Cascade

  • Jr. Member
  • **
  • Posts: 57
Configuring hints and warnings in the IDE messages panel
« on: October 07, 2025, 03:17:05 pm »
When compiling in the IDE, I've configured my project to not display hints indicating that the configuration file is being/has been read (see attached screenshot).  But the hints are still appearing.

Is there another place I need to configure such messages, apart from in the IDE Options dialog?

(I'd like to resolve the linker warnings and error message too - but maybe that's for a different post)

Thaddy

  • Hero Member
  • *****
  • Posts: 18305
  • Here stood a man who saw the Elbe and jumped it.
Re: Configuring hints and warnings in the IDE messages panel
« Reply #1 on: October 07, 2025, 04:38:24 pm »
In your fpc.cfg

Example: add a line
# parameter not used
-vw5024-
Or to disable Jonas case statement mix-up:
# silly case warnings
-vw8072-

These two keeps at least the most common out of sight.
These two should only show up with maximum verbosity.
The latter is a warning that should be a hint.
« Last Edit: October 07, 2025, 04:51:13 pm by Thaddy »
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

Cascade

  • Jr. Member
  • **
  • Posts: 57
Re: Configuring hints and warnings in the IDE messages panel
« Reply #2 on: October 07, 2025, 07:41:28 pm »
Thanks Thaddy - I'm guessing 5024 and 8072 are identifiers targeting a specific message.  Is there a full reference list somewhere?

(edit - found your wiki page: https://wiki.freepascal.org/Turn_warnings_and_hints_on_or_off)
« Last Edit: October 07, 2025, 07:44:35 pm by Cascade »

Cascade

  • Jr. Member
  • **
  • Posts: 57
Re: Configuring hints and warnings in the IDE messages panel
« Reply #3 on: October 07, 2025, 08:00:24 pm »
I've inserted a few entries into my fpc.cfg file as follows:

Code: Text  [Select][+][-]
  1. # Display Info, Warnings and Notes
  2. -viwn
  3. # Suppress config start/end reading hints:
  4. -v11030-
  5. -v11031-
  6. -v11034-
  7. # If you don't want so much verbosity use
  8. #-vw

That suppresses the End of Config hint, but not the Start of Config hint, which still appears.  Looks like I'm on the right track though...

Code: Text  [Select][+][-]
  1. # Display Info, Warnings and Notes
  2. -viwn
  3. # Suppress config start/end reading hints:
  4. -vw11030,11031,11034

No that's not it.  Hmm, tried -vh too.  Maybe I'm just tired, will have another go tomorrow...
🥱🫩😴💤
« Last Edit: October 07, 2025, 08:12:03 pm by Cascade »

Thausand

  • Sr. Member
  • ****
  • Posts: 390
Re: Configuring hints and warnings in the IDE messages panel
« Reply #4 on: October 07, 2025, 10:52:11 pm »
No that's not it.  Hmm, tried -vh too.  Maybe I'm just tired, will have another go tomorrow...

program:
Code: [Select]
$ echo "program test; {$mode objfpc}{$h+} begin writeln('hello world') end." > test.pas
compile:
Code: [Select]
$ fpc -B test.pas
Free Pascal Compiler version 3.2.2 [2021/05/16] for x86_64
Copyright (c) 1993-2021 by Florian Klaempfl and others
Target OS: Linux for x86-64
Compiling test.pas
Linking test
1 lines compiled, 0.0 sec

compile info:
Code: [Select]
$ fpc -B -viwn test.pas
Free Pascal Compiler version 3.2.2 [2021/05/16] for x86_64
Copyright (c) 1993-2021 by Florian Klaempfl and others
Target OS: Linux for x86-64
Compiling test.pas
Linking test
1 lines compiled, 0.0 sec

compile info + hint:
Code: [Select]
$ fpc -B -viwnh test.pas
Hint: Start of reading config file /home/apps/fpc/fpc.cfg
Hint: End of reading config file /home/apps/fpc/fpc.cfg
Free Pascal Compiler version 3.2.2 [2021/05/16] for x86_64
Copyright (c) 1993-2021 by Florian Klaempfl and others
Target OS: Linux for x86-64
Compiling test.pas
Linking test
1 lines compiled, 0.0 sec
2 hint(s) issued

compile have number for message:
Code: [Select]
$ fpc -B -vq test.pas
Free Pascal Compiler version 3.2.2 [2021/05/16] for x86_64
Copyright (c) 1993-2021 by Florian Klaempfl and others
(1002) Target OS: Linux for x86-64
(3104) Compiling test.pas
(9015) Linking test
(1008) 1 lines compiled, 0.0 sec

compile have all info:
Code: [Select]
$ fpc -B -viwnhq test.pas
Hint: (11030) Start of reading config file /home/apps/fpc/fpc.cfg
Hint: (11031) End of reading config file /home/apps/fpc/fpc.cfg
Free Pascal Compiler version 3.2.2 [2021/05/16] for x86_64
Copyright (c) 1993-2021 by Florian Klaempfl and others
(1002) Target OS: Linux for x86-64
(3104) Compiling test.pas
(9015) Linking test
(1008) 1 lines compiled, 0.0 sec
(1022) 2 hint(s) issued

compile have go away numbers (config read):
Code: [Select]
$ fpc -B -viwnhq -vm11030,11031 test.pas
Free Pascal Compiler version 3.2.2 [2021/05/16] for x86_64
Copyright (c) 1993-2021 by Florian Klaempfl and others
(1002) Target OS: Linux for x86-64
(3104) Compiling test.pas
(9015) Linking test
(1008) 1 lines compiled, 0.0 sec

Lazarus have own configuration https://wiki.freepascal.org/Turn_warnings_and_hints_on_or_off

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 11793
  • Debugger - SynEdit - and more
    • wiki
Re: Configuring hints and warnings in the IDE messages panel
« Reply #5 on: October 08, 2025, 08:38:54 am »
  Hmm, tried -vh too. 

-vh enables hints

afaik
-vh- disables them.

same for notes -vn- and warning  -vw-


About start reading conf... Putting anything inside fpc.cfg is to late for that. By that time it has already happened.

You have give it on the command line to the compiler. You can configure it in the project options, but you also need it for packages. (many packages import settings from "configure build IDE" so that may help for those.

Otherwise either in the package itself, or "additions and overrides"

Cascade

  • Jr. Member
  • **
  • Posts: 57
Re: Configuring hints and warnings in the IDE messages panel
« Reply #6 on: October 08, 2025, 11:19:54 am »
Thanks for the detailed info Thausand.

About start reading conf... Putting anything inside fpc.cfg is to late for that. By that time it has already happened.

 :) Of course!  Thank you.

Project Options > Custom Options...
-v0ehw
-vh-11030,11031,11034

Result...
Code: [Select]
Note: passing compiler option -vh twice with different values
This seems hard.  I removed my previous vh message values from fpc.cfg :-\ so where's the second one coming from I wonder?
« Last Edit: October 08, 2025, 11:23:45 am by Cascade »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 11793
  • Debugger - SynEdit - and more
    • wiki
Re: Configuring hints and warnings in the IDE messages panel
« Reply #7 on: October 08, 2025, 11:28:59 am »
Code: [Select]
Note: passing compiler option -vh twice with different values

Maybe you have -vh enabled on the verbosity tab (of the project options)?

Then if you specify it off in e.g. custom options, that is a 2nd occurrence of the same param.

gidesa

  • Full Member
  • ***
  • Posts: 196
Re: Configuring hints and warnings in the IDE messages panel
« Reply #8 on: October 09, 2025, 01:30:39 pm »
Thanks Thaddy - I'm guessing 5024 and 8072 are identifiers targeting a specific message.  Is there a full reference list somewhere?

(edit - found your wiki page: https://wiki.freepascal.org/Turn_warnings_and_hints_on_or_off)

Here a program that read the list of all possible messages from Fpc configuration files, and generate macros to set/unset one or more of them.
For every message there is the type and the number.
Included in zip there is the Fpc v 3.2.2 english messages configuration file errore.msg . But you should use the exact file from your Fpc installation (typically in directory Fpc\msg).
« Last Edit: October 09, 2025, 02:15:15 pm by gidesa »

Cascade

  • Jr. Member
  • **
  • Posts: 57
Re: Configuring hints and warnings in the IDE messages panel
« Reply #9 on: October 15, 2025, 12:29:03 pm »
Thanks for all the tips.  I spent a further hour or so on it, so will have to come back to it later.

I found -vh-11031 doesn't function when placed in Project Options > Compiler > Custom Options - for some reason it switches off all hints and warnings.  Closest I've got is the following setup...

Project Options > Compiler > Custom Options:
-v0ewh

In fpc.cfg:
-vw
-vh-11030,11031

That seems to keep the Messages window fairly clean, by removing most Verbose: messages, and 11031, while still allowing other hints and warnings to appear.  Hint 11030 still appears of course - but I can live with that :)

Thaddy

  • Hero Member
  • *****
  • Posts: 18305
  • Here stood a man who saw the Elbe and jumped it.
Re: Configuring hints and warnings in the IDE messages panel
« Reply #10 on: October 16, 2025, 09:53:10 am »
The minus sign is used in the wrong place. hence -vh-11031 turns off ALL hints. The minus sign should be after the number e.g: -vh11031-

or multiple
-vh5024,5028-
The comma separated values followed by a minus as the closing parameter.
You can also use e.g.
-vm5024,5028  (m stands for mute, any message number not to be shown, does not need the minus sign)
That is probably the  best option if you want to use it globally.
I usually turn things on or off in the sourcecode itself. This avoids missing warnings in places where they really need to be looked at.
« Last Edit: October 16, 2025, 10:22:05 am by Thaddy »
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

dseligo

  • Hero Member
  • *****
  • Posts: 1601
Re: Configuring hints and warnings in the IDE messages panel
« Reply #11 on: October 16, 2025, 11:52:01 am »
The minus sign is used in the wrong place. hence -vh-11031 turns off ALL hints. The minus sign should be after the number e.g: -vh11031-

or multiple
-vh5024,5028-
The comma separated values followed by a minus as the closing parameter.
You can also use e.g.
-vm5024,5028  (m stands for mute, any message number not to be shown, does not need the minus sign)
That is probably the  best option if you want to use it globally.
I usually turn things on or off in the sourcecode itself. This avoids missing warnings in places where they really need to be looked at.

This doesn't work in current trunk (i.e. messages 'Hint: Start of reading config file ...' and 'Hint: End of reading config file ...' are shown):
-vm11030,11031

That worked in the past.

While this works in current trunk:
-vh11030,11031-

P.S.: But it still doesn't work fine, it hides other messages

Options (among others) are: -vewnhibq
« Last Edit: October 16, 2025, 12:05:33 pm by dseligo »

Thaddy

  • Hero Member
  • *****
  • Posts: 18305
  • Here stood a man who saw the Elbe and jumped it.
Re: Configuring hints and warnings in the IDE messages panel
« Reply #12 on: October 16, 2025, 12:25:14 pm »
If there is code that enables or disables messages in the code, there may be your problem:
That will override any global options from the command line.
Code: Pascal  [Select][+][-]
  1. {$mode objfpc}{$warn 5024 on}{$warn 5028 on}
  2. function test(const t:integer):integer;
  3. begin
  4.   result := 10;
  5. end;
  6.  
  7. begin
  8. end.
Compiled with -vm5024,5028- will still show the hints, because the sourcecode has precedence.
I don't know if this is sufficiently documented.
Code: Text  [Select][+][-]
  1. fpc -vwhnql -vm5024,5028 testagain.pas
  2. Hint: (11030) Start of reading config file c:\fpcupdeluxe\fpc\bin\x86_64-win64\fpc.cfg
  3. Hint: (11031) End of reading config file c:\fpcupdeluxe\fpc\bin\x86_64-win64\fpc.cfg
  4. Free Pascal Compiler version 3.3.1-18664-g34855a61d3 [2025/10/06] for x86_64
  5. Copyright (c) 1993-2025 by Florian Klaempfl and others
  6. (1002) Target OS: Win64 for x64
  7. (3104) Compiling testagain.pas
  8. UNTITLED:2 9.747/10.496 Kb Used
  9. testagain.pas(5,21) Hint: (5024) Parameter "t" not used
  10. testagain.pas(5,10) Hint: (5028) Local proc "test" is not used
  11. (9015) Linking testagain.exe
  12. (1008) 11 lines compiled, 0.0 sec, 34304 bytes code, 1796 bytes data
  13. (1022) 4 hint(s) issued
« Last Edit: October 16, 2025, 12:55:04 pm by Thaddy »
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

 

TinyPortal © 2005-2018