Mail Archives: djgpp/1999/05/11/07:42:50
On 11.05.1999 Anders David Skarin wrote:
> My first message is going to be a strange (for me) warning:
> when gxx (gcc) tries to compile the following lines:
> 12 : for(treD_vertice *p = first; p->next; p=p-next)
^^^^^^^^^ should be
p=p->next
>13: p->next = new treD_vertice(0,x,y,z)
> ( this is a run through some dynamically allocated pointers to allocate
> a new one )
> i get the following warnings:
> 13 : name lookup of 'p' changed for new ANSI 'for' scoping
This is probably because you have declared p early in your program and
now redeclared it in sub-block. That's why name lookup has been changed.
Either eliminate previous declaration of p, or use p without
declaration in the 'for':
for(p = first; p->next; p=p-next) // p is declared before as treD_vertice *p;
> 12 : using obsolete binding at 'p'
'p=p-next' is not right operation. You're mistyped, I think.
Best regards,
Alexander Bokovoy, <bokovoy AT bspu DOT unibel DOT by>
= Linux ==============================================================
Though it is always possible to have a look at the world through the
Windows, people usually prefer not only to look but live in it too.
============================================================== Linux =
- Raw text -