bool and gcc

Jason Zions
Mon Aug 10 19:36:00 GMT 1998

> .cc:120: warning: name lookup of `index' changed for new ANSI `for'
> .cc:119: warning:   using obsolete binding at `index'
> What's that "new ANSI 'for' scoping" ?

ANSI C++ had a late change regarding the scoping rules for variables
declared as part of a "for" statement. I forget the specific details; I
remember reading an article in C/C++ Users Journal which discussed it.

> And the next one :
> request for member `figure' in `nodebufstat', which is of
> non-aggregate type `node *'
> Line 122 is :  *(nodebufstat).figure=-1 ;
> thats the structure "node" :
> typedef struct {
>                char  figure;
>                short base1,base2;
>               } node;
>... and that's declaration of nodebufstat pointer :
>node  *nodebufstat=&stattab[0];

That's just plain bad code on your part. Either you meant to write

	(*nodebufstat).figure = -1;

or you meant

	nodebufstat->figure = -1;

The error message is quite clear; it thought you were looking for a member
variable, 'figure', in the object 'nodebufstat'; unfortunately, that object
is a pointer to a node struct, not itself a node struct. You got the
dereference operator in the wrong place. (Check the precedence rules for '*'
as the dereference operator versus '.' as the member selection operator.)

Jason Zions
Softway Systems Inc.
For help on using this list (especially unsubscribing), send a message to
"" with one line of text: "help".

More information about the Cygwin mailing list