FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Como evitar warnings
Posts: 851
Joined: Sun Nov 09, 2014 05:01 PM
Como evitar warnings
Posted: Tue May 30, 2023 05:12 PM
Saludos Señores.

Hace dias hice una consulta sobre ciertos errores que estaban siendo ignorados por HARBOUR al momento de compilar.
Con la sugerencia de algunos colegas del grupo y finalmente con la ayuda de nuestro amigo Carlos Vargas (gracias nuevamente) logre solucionar, sin embargo, me quedó haciendo rudio algo que no le encuentro explicacion. Me explico:
Code (fw): Select all Collapse
Function Prueba()

  Local oQuery
  Local cQuery

...
...
...
  oQuery:=oQuery:=_oSqlConex:Query( cQuery )

return .t.

Al compilar, me muestra este warning:

Variable 'OQUERY' is assigned but not used in function ...

Es como si detectara a oQuery como una constante y no como variable,
estoy compilando con el parametro -w3 y se que si lo coloco en 2,1 o se elimina no vere mas este warning, pero no es lo que deseo
quiero mantener el -w3

¿Habra manera de evitarlo?

Por otro lado, aparecen muchos warning de este tipo:

Codeblock parameter 'SELF' declared but not used in function ...

de igual forma no quisiera que aparecieran. Ya alguien hizo la misma pregunta anteriormente y logró solucionarlo por lo que veo, pero no me queda clara cual fue la manera de solventarlo. Aca dejo el Hilo:

https://forums.fivetechsupport.com/viewtopic.php?f=3&t=41912&p=251309&hilit=Codeblock+parameter+%27SELF%27+declared+but+not+used+in+function&sid=10087f6d0d92d832b39f2b0423db16da&sid=10087f6d0d92d832b39f2b0423db16da#p251309

Agradezco si alguien sabe como evitar estos warnings, si se puede hacer manteniendo el -w3

estos son mis flags

-gtgui
-prgflag=/n /m /d__FLAT__ -gc0 -w3
-resflag=-D__FLAT__

Uso Fw17.01 + Harbour + Bcc7.4
"Los errores en programación, siempre están entre la silla y el teclado..."



Fwh 19.06 32 bits + Harbour 3.2 + Borland 7.4 + MariaDB + TDolphin



Carora, Estado Lara, Venezuela.
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Como evitar warnings
Posted: Tue May 30, 2023 05:28 PM

Intenta:

-prgflag=/n /m /d__FLAT__ -gc0 -w0

Saludos.

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 851
Joined: Sun Nov 09, 2014 05:01 PM
Re: Como evitar warnings
Posted: Tue May 30, 2023 05:46 PM
karinha wrote:Intenta:

-prgflag=/n /m /d__FLAT__ -gc0 -w0

Saludos.
Saludos estimado Joao,
Gracias por tu sugerencia.

Sí, efectivamente al hacerlo como indicas, no salen los warnings, pero tampoco muestra los errores como por ejemplo variables no declaradas realmente.

Quiero mantener el W3 pero sin los warnings de cosas sin sentido.

Por ejemplo,
Code (fw): Select all Collapse
Local oButtom

redefine BTNBMP oButtom ....


al compilar me arroja

Variable 'oButtom' is assigned but not used in function

y ese tipo de warnings son cientos de ellos, lo cual es molesto al compilar.
"Los errores en programación, siempre están entre la silla y el teclado..."



Fwh 19.06 32 bits + Harbour 3.2 + Borland 7.4 + MariaDB + TDolphin



Carora, Estado Lara, Venezuela.
Posts: 476
Joined: Sat Feb 03, 2007 06:36 AM
Re: Como evitar warnings
Posted: Wed May 31, 2023 11:52 AM

Hola José

Ya probaste con:

-prgflag=/N /W /ES2

Saludos

Carlos

Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Como evitar warnings
Posted: Wed May 31, 2023 12:02 PM
https://harbour.github.io/doc/harbour.html
Code (fw): Select all Collapse
Harbour 3.2.0dev (r2008190002)
Copyright (c) 1999-2020, https://harbour.github.io/

Syntax:  C:\HBBCC74\bin\harbour.exe <file[s][.prg]|@file> [options]

Options:  -a               automatic memvar declaration
          -b               debug info
          -build           display detailed version info
          -credits         display credits
          -d<id>[=<val>]   #define <id>
          -es[<level>]     set exit severity
          -fn[:[l|u]|-]    set filename casing (l=lower u=upper)
          -fd[:[l|u]|-]    set directory casing (l=lower u=upper)
          -fp[:<char>]     set path separator
          -fs[-]           turn filename space trimming on or off (default)
          -g<type>         output type generated is <type> (see below)
          -gc[<type>]      output type: C source (.c) (default)
                           <type>: 0=compact (default) 1=normal 2=verbose
                                   3=generate real C code
          -gh              output type: Harbour Portable Object (.hrb)
          -gd[.<destext>]  generate dependencies list into (.d) file
          -ge[<mode>]      error output <mode>: 0=Clipper (default)
                                                1=IDE friendly
          -i<path>         #include file search path
          -i[-|+]          disable/enable support for INCLUDE envvar
          -j[<file>]       generate i18n gettext file (.pot)
          -k               compilation mode (type -k? for more data)
          -l               suppress line number information
          -m               compile module only
          -n[<type>]       no implicit starting procedure
                           <type>: 0=no implicit starting procedure
                                   1=no starting procedure at all
                                   2=add starting procedure if necessary
          -o<path>         object file drive and/or path
          -p[<path>]       generate pre-processed output (.ppo) file
          -p+              generate pre-processor trace (.ppt) file
          -q               quiet
          -q0              quiet and don't display program header
          -q2              disable all output messages
          -ql              hide line counter gauge
          -r:<max>         set maximum number of preprocessor iterations
          -s[m]            syntax check only [minimal for dependencies list]
          -u[<file>]       use command def set in <file> (or none)
          -u+<file>        add command def set from <file>
          -undef:<id>      #undef <id>
          -v               variables are assumed M->
          -w[<level>]      set warning level number (0..3, default 1)
          -z               suppress shortcutting (.and. & .or.)
          @<file>          compile list of modules in <file>
Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 851
Joined: Sun Nov 09, 2014 05:01 PM
Re: Como evitar warnings
Posted: Wed May 31, 2023 01:46 PM
csincuir wrote:Hola José
Ya probaste con:

-prgflag=/N /W /ES2

Saludos

Carlos
Listo amigo, muchas gracias

Solucionado con -w1 -es2

Funciona tal cual como queria.

Agradecido neuvamente a este excelente foro.
"Los errores en programación, siempre están entre la silla y el teclado..."



Fwh 19.06 32 bits + Harbour 3.2 + Borland 7.4 + MariaDB + TDolphin



Carora, Estado Lara, Venezuela.

Continue the discussion