Jump to content
Excelsior Forums
oo

Procedure %s does not match previous definition (E155)

Recommended Posts

Hi,

  I am compiling some old code (not originally implement by me), and I get a number of errors of the form ?Procedure ?something? does not match previous definition (E155)?. I have copied the procedure declaration from the DEF File to the MOD File and I still get this error.

I have removed all of the other MOD Files from the directory where I am compiling. I have also checked all other DEF Files to ensure that this procedure is not declared anywhere else.

I?d be grateful for any ideas.

O.O.

Share this post


Link to post
Share on other sites

Could you please show the complete message about this error? Someting like this:

* [m.mod 4.11 E154]

* procedure "p" does not match previous definition:

  was: PROCEDURE [Modula] ()

  now: PROCEDURE [Modula] (INT32)

PROCEDURE $p(i: INTEGER);

errors  1, no warnings, lines    8, time  0.00

Alex

Share this post


Link to post
Share on other sites

Dear Alex,

Thanks for replying. I think I might have found my mistake ? but as this is not my code and as I have never programmed in Modula 2, I am going to take some time to verify this.

My complete error messages are too long but a snippet is something like:

* [VERIFICA.MOD 9.11 E155]

* procedure "vertab" does not match previous definition

PROCEDURE $vertab (VAR a,b,c:CARDINAL;VAR rowstart:ListPoint;VAR inf:Fil...

In VERIFICA.DEF we have

PROCEDURE vertab (VAR a,b,c:CARDINAL;VAR rowstart:ListPoint;VAR inf:File);

And in VERIFICA.MOD we have

PROCEDURE vertab (VAR a,b,c:CARDINAL;VAR rowstart:ListPoint;VAR inf:File);

These procedures are exactly the same. However it may be that File is imported from FIO in case of VERIFICA.DEF  but from IO in case of VERIFICA.MOD. This may make these procedures different though they are exactly the same to read. I did not realize this earlier ? and so I am looking into this aspect.

Thanks for posting. Once I get this clarified I would let you know.

O.O.

Share this post


Link to post
Share on other sites

It is always difficult to fix problems with the old, legacy code...

The most interesting (and informative) part of the compiler's output is the next two lines (from my example above):

  was: PROCEDURE [Modula] ()

  now: PROCEDURE [Modula] (INT32)

The compiler should explain why it decides that a procedure does not match the previous definition. Usually it helps.

Good luck!

Share this post


Link to post
Share on other sites

Thanks  sleepyhead

Actually with the E155 the complier does not report the incompatible types. If it can ? then it reports the error E154, which I am not getting.

Anyway my professor asked me to copy the Import statement from the DEF File to the MOD File. This seemed to work for me i.e. that error has gone away. However my file still does not compile. But I don?t think that it is due to the error about the procedure definition not matching.

I think I would start another thread on that error.

Thanks for you help.

O.O.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×