Como evitar warnings

Como evitar warnings

Postby JoseAlvarez » Tue May 30, 2023 5: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: Select all  Expand view
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.
User avatar
JoseAlvarez
 
Posts: 726
Joined: Sun Nov 09, 2014 5:01 pm

Re: Como evitar warnings

Postby karinha » Tue May 30, 2023 5:28 pm

Intenta:

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

Saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7214
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Como evitar warnings

Postby JoseAlvarez » Tue May 30, 2023 5: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: Select all  Expand view
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.
User avatar
JoseAlvarez
 
Posts: 726
Joined: Sun Nov 09, 2014 5:01 pm

Re: Como evitar warnings

Postby csincuir » Wed May 31, 2023 11:52 am

Hola José
Ya probaste con:

-prgflag=/N /W /ES2

Saludos

Carlos
csincuir
 
Posts: 396
Joined: Sat Feb 03, 2007 6:36 am
Location: Guatemala

Re: Como evitar warnings

Postby karinha » Wed May 31, 2023 12:02 pm

https://harbour.github.io/doc/harbour.html

Code: Select all  Expand view

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
User avatar
karinha
 
Posts: 7214
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Como evitar warnings

Postby JoseAlvarez » Wed May 31, 2023 1: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.
User avatar
JoseAlvarez
 
Posts: 726
Joined: Sun Nov 09, 2014 5:01 pm


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 77 guests