   No C99 support in VC++?
  Hi guys,I was compiling a large C project I wrote, this time using VC++ express 2008. It's worked fine but I didn't think I'd run into compilation errors using VS. I'm getting errors telling me the following: "illegal use of this type as an expression". This is meant towards one of my typedefed struct types. I thought this was an error you'd get in early versions of C where you couldn't declare anything in a function except at function scope, incase there was an expression.I thought C99 didn't require this, and I'd think that compiling in C using VC++ would support this. Or are some of my settings wrong? If my assumption is correct, is it possible to update this?Cheers,Brick   
  MSVC has no support for C99, save a few random extensions.   ;  MSVC supports a handful of C99 features, but by no means all. It doesn't entirely sound like this is a C89/C99 issue, though. Post your code and the errors.   ;  Some of c99 is supported in VC2008.Note that your files must be compiled in c mode rather than c++ mode.  This is usually detected by the file name, but it can be configured.  The compiler option is /TC to force compilation as C code, if it isn't correctly selecting the language.   ;  Ok, too bad, but thanks for the info.I looked up some of the "new" features that C99 brought in and I think this would solve my problem:"intermingled declarations and code, variable declaration no longer restricted to file scope or the start of a compound statement (block)"Either way I get around 500 errors or so just because of this when using VC++. Not much of a bummer, I just wanted to try and compile it with that compiler.I have another question though. As far as I know, gcc implements the C99 standard quite well. Is it possible to write win32 applications in C and compile them with gcc using MinGW? Does anyone know of a good documentation on this topic?Cheers,Brick   ;Quote:Original post by BrickInTheWallOk, too bad, but thanks for the info.I looked up some of the "new" features that C99 brought in and I think this would solve my problem:"intermingled declarations and code, variable declaration no longer restricted to file scope or the start of a compound statement (block)"Either way I get around 500 errors or so just because of this when using VC++. Not much of a bummer, I just wanted to try and compile it with that compiler.A minimal testcase would clear things up very well, I think ;)Quote:I have another question though. As far as I know, gcc implements the C99 standard quite well. Is it possible to write win32 applications in C and compile them with gcc using MinGW?Absolutely.Quote:Does anyone know of a good documentation on this topic?I don't know any good documentation for MSVC things, but if you want to write portable window (not windows) applications, then there's a megaton of it.;Quote:Original post by BrickInTheWallI get around 500 errors or so just because of this when using VC++.500 errors doesn't mean "500 things you'd have to change to get this to compile". A single error tends to confuse the compiler for the next few lines, so you get a bunch of spurious ones after the first, real one. Try manually fixing a couple, either by moving the declarations to the top of the function or by putting them and the rest of the function in an anonymous block, and see how quickly things clear up.   