Skip to content

warning: implicit declaration of function #88

Open
@norayr

Description

@norayr
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions