Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

warning: implicit declaration of function #88

Open
norayr opened this issue May 11, 2020 · 0 comments
Open

warning: implicit declaration of function #88

norayr opened this issue May 11, 2020 · 0 comments

Comments

@norayr
Copy link
Member

norayr commented May 11, 2020

MODULE test;
CONST
  InitialSize = 64;

TYPE
  something* = POINTER TO RECORD
    length-: LONGINT; (* current length of string excluding 0X *)
    bufferSize: LONGINT; (* {bufferSize >= InitialSize} *)
    buffer : POINTER TO ARRAY OF CHAR;
  END;

PROCEDURE (this: something) Clear*;
BEGIN
  this.buffer[0] := 0X;
  this.length := 0
END Clear;

PROCEDURE (this: something) Init*;
BEGIN
  this.bufferSize := InitialSize;
  NEW(this.buffer, this.bufferSize);
  this.Clear
END Init;

END test.

when compiling we have a warning:

 $ /opt/voc/bin/voc -s test.Mod 
test.Mod  Compiling test.  818 chars.
test.c: In function ‘test_something_Init’:
test.c:37:2: warning: implicit declaration of function ‘__test_something_Clear’; did you mean ‘test_something_Clear’? [-Wimplicit-function-declaration]
   37 |  __test_something_Clear(this);
      |  ^~~~~~~~~~~~~~~~~~~~~~
      |  test_something_Clear

this is solvable by removing the OPM.WriteString call at line 863 in OPV.Mod

                       IF n^.left^.subcl = OPT.super THEN proc := SuperProc(n)
                       ELSE (*OPM.WriteString("__");*) proc := OPC.BaseTProc(n^.left^.obj)
                       END ;

There is other OPM.WriteString("__"); at line 631 of OPV.Mod, that handles different case, and doesn't affect this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant