jesse_adkins
April 6th, 2008, 02:36 AM
I was messing around one day, and I got this error message...
///
test.c:8 error: called object 'x' is not a function.
///
From this code...
///
struct x {
int x;
};
void x(int v)
{
struct x x;
x(x.x);
}
///
I'm no expert at C, nor would I be caught with this in 'real code'. However, this one seems curious to me, since GCC doesn't give any errors about the function sharing a name with a variable and/or a struct. Am I just overreacting, or could this be a bug of some sort?
gcc 4.2.3, Ubuntu 8.04 (Hardy)
///
test.c:8 error: called object 'x' is not a function.
///
From this code...
///
struct x {
int x;
};
void x(int v)
{
struct x x;
x(x.x);
}
///
I'm no expert at C, nor would I be caught with this in 'real code'. However, this one seems curious to me, since GCC doesn't give any errors about the function sharing a name with a variable and/or a struct. Am I just overreacting, or could this be a bug of some sort?
gcc 4.2.3, Ubuntu 8.04 (Hardy)