Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2004-07

Extension of macros exceeds a depth of 16

4 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Alan Mead

As a I mentined earlier today in a different thread, I have upgraded to 1.9.4 and I appreciate the greater checking.

Most of the new warnings I get are clear but one of my units now reports "Extension of macros exceeds a depth of 16". What does this warning mean and what is the rammification of ignoring it?

The line number where it reports the warning is an {$if def ...} and I would assume the warning had something to do with nesting compiler conditionals... but that's not the case (unless the parser is really getting lost... but since the code operates, I cannot imagne that this is happening..). This conditional should be at the "top level"--it is not nested under anything.

-Alan

Reply by email

Olle Raab
to Alan Mead

04-07-28 21.42, skrev Alan Mead följande:

Show quoted text 5 lines
As a I mentined earlier today in a different thread, I have upgraded to 1.9.4 and I appreciate the greater checking. Most of the new warnings I get are clear but one of my units now reports "Extension of macros exceeds a depth of 16". What does this

^^^^^^^^^^
Actually I think the warning message is wrong..

It should imo be "Expanding". I'll fix this.

Show quoted text 8 lines
warning mean and what is the rammification of ignoring it? The line number where it reports the warning is an {$if def ...} and I would assume the warning had something to do with nesting compiler conditionals... but that's not the case (unless the parser is really getting lost... but since the code operates, I cannot imagne that this is happening..). This conditional should be at the "top level"--it is not nested under anything.

It the recursive macro substitution which exceeds a depth of 16.

This is probably due to a circular definition of a macro, e g

{$DEFINE X = X}

So that X is replaced by X, which is replaced by X etc. This is probably not what you want.

After 16 replacements the recursion is stoped, thats what it is warned about.

Olle

Reply by email

Alan Mead
to Olle Raab

Ah. Or "Recursion of macros exceeds..." I'll check my code.

-Alan

--- Olle Raab wrote 47 lines
04-07-28 21.42, skrev Alan Mead f�ljande: > As a I mentined earlier today in a different thread, I have upgraded > to 1.9.4 and I appreciate the greater checking. > > Most of the new warnings I get are clear but one of my units now > reports "Extension of macros exceeds a depth of 16". What does this ^^^^^^^^^^ Actually I think the warning message is wrong.. It should imo be "Expanding". I'll fix this. > warning mean and what is the rammification of ignoring it? > > The line number where it reports the warning is an {$if def ...} and > I would assume the warning had something to do with nesting compiler > conditionals... but that's not the case (unless the parser is really > getting lost... but since the code operates, I cannot imagne that > this is happening..). This conditional should be at the "top > level"--it is not nested under anything. It the recursive macro substitution which exceeds a depth of 16. This is probably due to a circular definition of a macro, e g {$DEFINE X = X} So that X is replaced by X, which is replaced by X etc. This is probably not what you want. After 16 replacements the recursion is stoped, thats what it is warned about. Olle _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email

Olle Raab
to Olle Raab: 04-07-28 21.42, skrev Alan Mead följande: ^^^^^^^^^^ Actually I think the warning…

04-08-04 13.39, skrev Olle Raab följande:

Show quoted text 32 lines
04-07-28 21.42, skrev Alan Mead följande: > As a I mentined earlier today in a different thread, I have upgraded > to 1.9.4 and I appreciate the greater checking. > > Most of the new warnings I get are clear but one of my units now > reports "Extension of macros exceeds a depth of 16". What does this ^^^^^^^^^^ Actually I think the warning message is wrong.. It should imo be "Expanding". I'll fix this. > warning mean and what is the rammification of ignoring it? > > The line number where it reports the warning is an {$if def ...} and > I would assume the warning had something to do with nesting compiler > conditionals... but that's not the case (unless the parser is really > getting lost... but since the code operates, I cannot imagne that > this is happening..). This conditional should be at the "top > level"--it is not nested under anything. It the recursive macro substitution which exceeds a depth of 16. This is probably due to a circular definition of a macro, e g {$DEFINE X = X} So that X is replaced by X, which is replaced by X etc. This is probably not what you want. After 16 replacements the recursion is stoped, thats what it is warned about.

I found that there really was a bug here.

With

{$DEFINE X}
{$IF X = 1}

etc..

You get the above error message, just because X does not have any value. (it then erroneously made a recurson). This is now fixed.

On the other hand, the above snippet is actually worng, beacause X does not hae any value, and should not be allowed in an expression.

I will add error checking for this.

Olle

Reply by email