bobleny
02-26-2010, 04:57 AM
This is basically the same thing as the last warning I asked about. This time it is about a structure.
The structure:
typedef struct node
{
// Next available memory location
pNode next;
// The memory location of the content struct
pContent data;
}; // The error is actually reported right here
I thought it had something to do with this line here, which is above the structure,:
typedef struct node *pNode;
but when you remove that line, the warning doesn't change. Of course I get a billion other warnings as expected...
Does this have something to do with the way the structure is declared?
I see structures declared like that all the time, but I also see them declared like this:
typedef struct
{
// Stuff
}node;
I pretty sure I've seen them declared in other ways too. The second structure doesn't seem to work in this case though. What is the difference?
The structure:
typedef struct node
{
// Next available memory location
pNode next;
// The memory location of the content struct
pContent data;
}; // The error is actually reported right here
I thought it had something to do with this line here, which is above the structure,:
typedef struct node *pNode;
but when you remove that line, the warning doesn't change. Of course I get a billion other warnings as expected...
Does this have something to do with the way the structure is declared?
I see structures declared like that all the time, but I also see them declared like this:
typedef struct
{
// Stuff
}node;
I pretty sure I've seen them declared in other ways too. The second structure doesn't seem to work in this case though. What is the difference?