Warning W0004

73 views
Skip to first unread message

Enrico Maria Giordano

unread,
Feb 9, 2024, 9:31:06 AMFeb 9
to Harbour Project Developers Mailing List
Is there a way to silence the following warning without touching the
source code?

test.prg(3) Warning W0004 Codeblock parameter 'XVAR' declared but not
used in function 'MAIN'

This is test.prg:

FUNCTION MAIN()

LOCAL bBlk := { | xVar | Test() }

EVAL( bBlk )

INKEY( 0 )

RETURN NIL


STATIC FUNCTION TEST()

? "TEST"

RETURN NIL

In xHarbour there is the switch -wb-. Any suggestions are welcome.

--
Enrico Maria Giordano

http://www.emagsoftware.it
http://www.emagsoftware.it/emgmusic
http://www.emagsoftware.it/spectrum
http://www.emagsoftware.it/tbosg

Gerald Drouillard

unread,
Feb 9, 2024, 9:40:57 AMFeb 9
to harbou...@googlegroups.com
It is just a warning
xVar is not used. So remove it from the block.
I think you can just add a line to the code:
(xVar)
to suppress the warning.
> --
> You received this message because you are subscribed to the Google Groups "Harbour Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to harbour-deve...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-devel/cd54e0fb-890d-44de-b542-3e56a570f15b%40emagsoftware.it.
>

Enrico Maria Giordano

unread,
Feb 9, 2024, 9:57:56 AMFeb 9
to harbou...@googlegroups.com


Il 09/02/2024 15:40, Gerald Drouillard ha scritto:

>> Is there a way to silence the following warning without touching the
>> source code?
>
> It is just a warning
> xVar is not used. So remove it from the block.
> I think you can just add a line to the code:
> (xVar)
> to suppress the warning.

I wrote "without touching the source code". :-)

Lailton Fernando Mariano

unread,
Feb 9, 2024, 1:33:14 PMFeb 9
to Harbour Developers
You can use -w1 to the .hbm or hbmk2 command line. then it will not show the warning.

Enrico Maria Giordano

unread,
Feb 9, 2024, 1:40:41 PMFeb 9
to harbou...@googlegroups.com


Il 09/02/2024 19:33, Lailton Fernando Mariano ha scritto:

> You can use -w1 to the .hbm or hbmk2 command line. then it will not show
> the warning.

I prefer to set the maximum warning level and suppress only the warning
W0004. Is that possible? Can the switch -wb- be implemented?

Bacco

unread,
Feb 9, 2024, 2:06:34 PMFeb 9
to harbou...@googlegroups.com
I believe this discussion fits better in the users list, not the development one.

--
You received this message because you are subscribed to the Google Groups "Harbour Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-deve...@googlegroups.com.

Enrico Maria Giordano

unread,
Feb 9, 2024, 3:06:57 PMFeb 9
to harbou...@googlegroups.com


Il 09/02/2024 20:05, Bacco ha scritto:

>> I prefer to set the maximum warning level and suppress only the warning
>> W0004. Is that possible? Can the switch -wb- be implemented?
>
> I believe this discussion fits better in the users list, not the
> development one.

No, as I asked if it can be implemented (even myself).
Reply all
Reply to author
Forward
0 new messages