>>48
1. dear lord no just no
2. who cares
3. I think you are confused about the purpose of "sizeof" it is for determining the size of types not objects (yes C has objects I read the standard and I know the definition of "object" in C) and you can write your own goddamn malloc with this feature if you need it to hold your hand this badly... if you think for just a couple minutes about this request you'll realize it's bull because if you don't know how big your object is based on its type then you need to go back to Java or Python or something because systems programming really isn't your thing you know
int a[10], *p = NULL;
sizeof(a); // 40 -- what do *you* think it should be?
sizeof(p); // 4 on 32bit OF COURSE because you're asking for size of a pointer
sizeof(*p); // 4 because you're asking for the size of an int
the above is quite sane and natural and if you're confused about array and sizeof you're really confused about types, go learn about array "decay" because nobody ever really wanted to pass arrays by value so they turn into pointers... if you need sizeof to work you can make the pointer explicit like this:
void func1(int a[1000])
{
sizeof(a); // 4 on 32bit because a is a POINTER not an array
// do you honestly think 4k is reasonable for function args? NO
// that's why arrays are pass by reference and
// effrything else is pass by value just remember that one bit and you'll be fine
}
void func2(int (*a)[1000])
{
sizeof(*a); // 4000, duh
}
and if you really want to pass arrays by value then you put them in a struct which is fine too
>>50
that's what void is for, maybe you are just wishing for pointer arithmetic with void pointers which would be nice but that's not what you asked for
it's a damn good thing incompatible pointer assignments (EXCEPT to/from "void *", of course) generate errors because we C programmers crash enough as it is and if they didn't generate errors you'd get crap like this:
fprintf("welcome mister %s\n", luser_name);
in your magical C this would compile fine but you know in my world a "char *" is nothing at all like a "FILE *" (do you know how goddamn often I make this mistake too? compilers are HELPING by catching errors jeez)
and to all the people asking for better macros you know you could just write your own preprocessor that's fine you don't need to mess with mine... you've probably got M4 on your system and Perl and you could probably whip up some real ugly shit to generate C code that looks like it was made by satan's own enterprise coding time