Discussion:
[xHarbour-developers] Compiler bug?
Enrico Maria Giordano
2016-12-11 10:07:53 UTC
Permalink
Probably I already reported this in the past but I can't remember the
answer, sorry.

Please compile the following sample:

FUNCTION MAIN()

? TEST()

INKEY( 0 )

RETURN NIL


STATIC FUNCTION TEST()

LOCAL nVar := 1

LOCAL lVar := .T.

BEGIN SEQUENCE
IF lVar
nVar = 2
BREAK
ENDIF

nVar = 3
END SEQUENCE

RETURN nVar

I get:

test.prg(26) Warning W0032 Variable 'NVAR' is assigned but not used in
function 'TEST(18)'

Why? It seems that the compiler ignores the BREAK when it search for the
warnings.

EMG

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

Loading...