Typedef with GCC/G++
From: Jeff Mott (mjeff1_at_twcny.rr.com)
Date: 11/19/04
- Next message: Chandrashekar Tippur: "Initializing array of structure!!"
- Previous message: Robert Gamble: "Re: How to best parse a CSV data file and do a lookup in C?"
- Next in thread: Mac: "Re: Typedef with GCC/G++"
- Reply: Mac: "Re: Typedef with GCC/G++"
- Reply: Arthur J. O'Dwyer: "Re: Typedef with GCC/G++"
- Reply: Keith Thompson: "Re: Typedef with GCC/G++"
- Reply: Dan Pop: "Re: Typedef with GCC/G++"
- Reply: Eric Schmidt: "Re: Typedef with GCC/G++"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 18 Nov 2004 21:46:54 -0800
Given the following example code
typedef
struct fubar *
fubar;
struct fubar
{
};
int main(void)
{
return 0;
}
GCC on Windows will compile this fine, but G++ throws an error saying
3: error: conflicting types for 'typedef struct fubar*fubar'
2: error: previous declaration as 'struct fubar'
6: error: conflicting types for 'struct fubar'
3: error: previous declaration as 'typedef struct fubar*fubar'
Now I know I can avoid this error by simply renaming the struct to
something else, but I'd prefer to understand why this is interpreted
differently.
- Next message: Chandrashekar Tippur: "Initializing array of structure!!"
- Previous message: Robert Gamble: "Re: How to best parse a CSV data file and do a lookup in C?"
- Next in thread: Mac: "Re: Typedef with GCC/G++"
- Reply: Mac: "Re: Typedef with GCC/G++"
- Reply: Arthur J. O'Dwyer: "Re: Typedef with GCC/G++"
- Reply: Keith Thompson: "Re: Typedef with GCC/G++"
- Reply: Dan Pop: "Re: Typedef with GCC/G++"
- Reply: Eric Schmidt: "Re: Typedef with GCC/G++"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|