
It's been years since I last used a Microsoft C compiler, but I can recall that, at some point in time, Visual C was perfectly capable of accepting valid, ANSI standard C code. So I'm a bit suspicious when I read things like:
Berin Loritsch: “Apparently it is OK to have a struct declared as a stack variable in GCC but not in Visual C. I have to declare the struct for use outside the function! When I do that everything works OK. I find this to be a problem, but at this stage of the game it is not that big a deal. The issue is that C is not C. I have to write the software so that both pieces work.”
Well, C has been C since 1989, if I remember correctly. And while Microsoft wouldn't certainly be above redefining it somehow to fit their needs, I simply cannot believe that the Visual C compiler won't accept code like:
typedef struct
{
int numProcessors;
} sysinfo;
int main(void) {
sysinfo info;
info.numProcessors = 1;
return 0;
}
To me, this looks kosher.


0 Responses to “Re: When C doesn't compile”