Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2021-09

Promote specific warning into error

5 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Marc Weustink
to Marc Weustink
Marc Weustink wrote
Hi, Is there a way to promote a specific warning(4056) into an error ?

from the commandline I mean. I've found {$warn 4056 error} but I don't want to put this in all sources

Thanks Marc

Reply by email

Michael Van Canneyt
to Marc Weustink
Marc Weustink wrote 7 lines
On 24-9-2021 14:24, Marc Weustink via fpc-devel wrote: > Hi, > > Is there a way to promote a specific warning(4056) into an error ? from the commandline I mean. I've found {$warn 4056 error} but I don't want to put this in all sources

The command-line only allows to set this for all warnings/hints/notes.

-Se<x> Error options. <x> is a combination of the following: <n> : Compiler halts after the <n> errors (default is 1) h : Compiler also halts after hints
n : Compiler also halts after notes
w : Compiler also halts after warnings

I didn't see a way to do this for specific message numbers. I think at this point your best bet is to create a small include file that is included in all files ?

Michael.

Reply by email

Marc Weustink
to Michael Van Canneyt
Michael Van Canneyt wrote 23 lines
On Fri, 24 Sep 2021, Marc Weustink via fpc-devel wrote: > On 24-9-2021 14:24, Marc Weustink via fpc-devel wrote: >> Hi, >> >> Is there a way to promote a specific warning(4056) into an error ? > > from the commandline I mean. I've found {$warn 4056 error} but I don't > want to put this in all sources The command-line only allows to set this for all warnings/hints/notes.  -Se<x>     Error options. <x> is a combination of the following:          <n> : Compiler halts after the <n> errors (default is 1)          h : Compiler also halts after hints          n : Compiler also halts after notes          w : Compiler also halts after warnings I didn't see a way to do this for specific message numbers. I think at this point your best bet is to create a small include file that is included in all files ?

what I've done for the current project (need to check more) is -Sew and several -vmXXXX for all warnings I'm not interested in (like deprecated, uninitialized variables passed to SetLength() etc)

Marc

Reply by email