'Symbol not previously declared' for subroutines that are part of project

'Symbol not previously declared' for subroutines that are part of project

Bild des Benutzers kvrichardson

I'm getting tons of these warnings for calls to subroutines that are included in my project.
C:Cp32TenTensiz.for(404) : Warning: Symbol not previously declared. [LPRINT]
call LPRINT(box(7),44,0)

How do I get rid of them?

The LPRINT subroutine is in my project, so I'm not sure why it's saying "not declared".

Thanks,

Keith Richardson

6 Beiträge / 0 neu
Letzter Beitrag
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.
Bild des Benutzers Steve Lionel (Intel)

Short answer - you have !DEC$ (or !MS$) DECLARE in your source and have not explicitly declared LPRINT. However, the documentation doesn't lead me to believe that a subroutine reference should trigger this warning - IMPLICIT NONE doesn't. I'll ask the appropriate engineer about it.

You can add EXTERNAL LPRINT (or whatever) to "declare" the routines, or switch to using the standard IMPLICIT NONE instead of the old MS DECLARE directive.

Steve

Steve
Bild des Benutzers Steve Lionel (Intel)

Longer answer - this is a bug which has been in the compiler for several years! We'll fix it. My advice above still holds.

Steve

Steve
Bild des Benutzers Jugoslav Dujic

I wonder how would a still longer answer look like :-)?
Besides, Steve, don't be so eager to say it's a bug -- I'm sure that some Microsoft people would say "oh, it's not a bug, it's a feature" -- after all, these subroutines are kind of undeclared, since they don't have neither EXTERNAL nor INTERFACE block.

(Oh, yes, these warning messages are a real PITA)

Jugoslav

Jugoslav www.xeffort.com
Bild des Benutzers kvrichardson

Luckily we only had one !DEC$ DECLARE statement - and removing it did the trick!

Thanks, Steve.

Keith Richardson

Bild des Benutzers Steve Lionel (Intel)

It is a bug. The documentation clearly states that the behavior should be the same as that for IMPLICIT NONE, which requires that every object with a datatype must be explicitly typed. A subroutine has no type, therefore should not be considered "undeclared" here.

At first, I wondered if MS had a stricter definition, requiring an explicit interface for subroutines, but their manual says not. While this would be an interesting definition, and even useful, it's not what's documented, so bug it is.

Steve

Steve

Melden Sie sich an, um einen Kommentar zu hinterlassen.