www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/05/11/07:42:50

Date: Tue, 11 May 1999 14:23:51 +0300
From: Alexander Bokovoy <bokovoy AT bspu DOT unibel DOT by>
X-Mailer: The Bat! (v1.30) UNREG
Organization: BSPU named after Maxim Tank
X-Priority: 3 (Normal)
Message-ID: <12599.990511@bspu.unibel.by>
To: Anders David Skarin <djgpp AT delorie DOT com>
Subject: Re: New ANSI standard
In-reply-To: <373752C8.2F62DBA9@swipnet.se>
References: <373752C8 DOT 2F62DBA9 AT swipnet DOT se>
Mime-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019