Atualização Harbour 19-05-2023

Projeto [x]Harbour - Compilador de código aberto compatível com o Clipper.

Moderador: Moderadores

Avatar do usuário
Itamar M. Lins Jr.
Administrador
Administrador
Mensagens: 7928
Registrado em: 30 Mai 2007 11:31
Localização: Ilheus Bahia
Curtiu: 1 vez

Atualização Harbour 19-05-2023

Mensagem por Itamar M. Lins Jr. »

Olá!
Correção bug classes.

Código: Selecionar todos

2023-05-19 16:29 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
  * include/hbclass.ch
    ! fixed declaration stripping when HB_CLS_NO_DECLARATIONS is defined

  * src/compiler/hbmain.c
    ! do not generate warnings for undeclared methods when -w[12] is used.
      They should be emitted only for -w3 or higher (if any in the future).
      Thanks to Toninho for the information about the problem.

best regards
Przemek
Saudações,
Itamar M. Lins Jr.
Saudações,
Itamar M. Lins Jr.
Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

Atualização Harbour 19-05-2023

Mensagem por JoséQuintas »

É só comentário

Código: Selecionar todos

#include "inkey.ch"
#include "hbclass.ch"

PROCEDURE Main

   SetMode(33,100)
   SetColor( "W/B" )
   CLS
   Inkey(0)


   RETURN

PROCEDURE HB_GTSYS
   REQUEST HB_GT_WVG_DEFAULT
   RETURN

FUNCTION AppVersaoExe(); RETURN ""
FUNCTION AppUserName(); RETURN ""

STATIC CREATE CLASS test
   VAR x
   ENDCLASS
A declaração de classe está errada, STATIC não é no início, é no final.

compilando -w0
test.prg:21: error E0004 STATIC declaration follows executable statement
test.prg:23: error E0030 Syntax error "syntax error at 'ALWAYS'"
2 errors
compilando -w1
test.prg:21: error E0004 STATIC declaration follows executable statement
test.prg:22: warning W0001 Ambiguous reference 'OCLASS'
test.prg:22: warning W0001 Ambiguous reference 'NSCOPE'
test.prg:23: warning W0001 Ambiguous reference 'OCLASS'
test.prg:23: error E0030 Syntax error "syntax error at 'ALWAYS'"
test.prg:23: warning W0001 Ambiguous reference 'S_OCLASS'
test.prg:23: warning W0001 Ambiguous reference 'OCLASS'
test.prg:23: warning W0001 Ambiguous reference 'OCLASS'
test.prg:23: warning W0001 Ambiguous reference 'OINSTANCE'
test.prg:23: warning W0001 Ambiguous reference 'OINSTANCE'
test.prg:23: warning W0001 Ambiguous reference 'OINSTANCE'
test.prg:23: warning W0001 Ambiguous reference 'OINSTANCE'
test.prg:23: warning W0001 Ambiguous reference 'S_OCLASS'
2 errors
compilando -w2
test.prg:21: warning W0028 Unreachable code
test.prg:21: error E0004 STATIC declaration follows executable statement
test.prg:22: warning W0001 Ambiguous reference 'OCLASS'
test.prg:22: warning W0001 Ambiguous reference 'NSCOPE'
test.prg:23: warning W0001 Ambiguous reference 'OCLASS'
test.prg:23: error E0030 Syntax error "syntax error at 'ALWAYS'"
test.prg:23: warning W0001 Ambiguous reference 'S_OCLASS'
test.prg:23: warning W0001 Ambiguous reference 'OCLASS'
test.prg:23: warning W0001 Ambiguous reference 'OCLASS'
test.prg:23: warning W0001 Ambiguous reference 'OINSTANCE'
test.prg:23: warning W0001 Ambiguous reference 'OINSTANCE'
test.prg:23: warning W0001 Ambiguous reference 'OINSTANCE'
test.prg:23: warning W0001 Ambiguous reference 'OINSTANCE'
test.prg:23: warning W0028 Unreachable code
test.prg:23: warning W0001 Ambiguous reference 'S_OCLASS'
2 errors
compilando -w3
test.prg:21: warning W0028 Unreachable code
test.prg:21: error E0004 STATIC declaration follows executable statement
Class member 'X' declaration without class definition.
test.prg:22: warning W0001 Ambiguous reference 'OCLASS'
test.prg:22: warning W0001 Ambiguous reference 'NSCOPE'
test.prg:23: warning W0001 Ambiguous reference 'OCLASS'
test.prg:23: error E0030 Syntax error "syntax error at 'ALWAYS'"
test.prg:23: warning W0001 Ambiguous reference 'S_OCLASS'
test.prg:23: warning W0001 Ambiguous reference 'OCLASS'
test.prg:23: warning W0001 Ambiguous reference 'OCLASS'
test.prg:23: warning W0001 Ambiguous reference 'OINSTANCE'
test.prg:23: warning W0001 Ambiguous reference 'OINSTANCE'
test.prg:23: warning W0001 Ambiguous reference 'OINSTANCE'
test.prg:23: warning W0001 Ambiguous reference 'OINSTANCE'
test.prg:23: warning W0028 Unreachable code
test.prg:23: warning W0001 Ambiguous reference 'S_OCLASS'
3 errors
Seja qual for a opção, é o primeiro erro que aparece, os demais são consequência.
É que quem olhar a lista, parece uma doideira sem sentido.

Mas antes das alterações, causava GPF no compilador harbour, e ele abortava a compilação.
Agora ele prossegue até o fim.

E a alteração atual é porque a correção anterior gerou problemas no uso normal.
Agora todas estão ok, os que mostrei aqui, e o problema gerado na alteração anterior.

O problema criado na alteração anterior nem tem o que mostrar, compila normalmente em todos os casos, seria esse mesmo fonte sem o STATIC.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"

https://github.com/JoseQuintas/
Responder