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

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

kvrichardson's picture

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 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
Steve Lionel (Intel)'s picture

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
Steve Lionel (Intel)'s picture

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
Jugoslav Dujic's picture

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
kvrichardson's picture

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

Thanks, Steve.

Keith Richardson

Steve Lionel (Intel)'s picture

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

Login to leave a comment.