Cliff Woolley <[EMAIL PROTECTED]> writes:
> > Evidently, VC. Although I will say I was very tired...
>
> If you mean "lousy _C_ compiler", I don't know. A lousy one. ;-] If you
> mean "lousy C++ compiler used to compile C code", the answer is probably
> all of them. C++ doesn't much mind you declaring variables right in the
> middle of a basic block. Since MSVC is a C++ compiler at heart, I find it
> unsurprising that it wouldn't complain about constructs like this. I'm
> 99% sure g++ wouldn't complain either. (I've actually done something like
> that accidentially one time while cut-and-pasting some code, and then
> couldn't figure out what the hell the problem was when I took my C code
> that compiled perfectly well with g++ and it bombed when I switched back
> to gcc. Doh, C is context sensitive about variable declarations, C++
> isn't. Crap. =-)
weird...
(this may be my lack of Visual Studio 5.0 skills, but anyway...) I
just tried to create a new C file and there wasn't such a thing on the
menu. I can create a "C/C++ Header File" or a "C++ Source File."
>From the command-line (cl.exe) I tried to compile something like
int main(void) { char x; x = 0; char y; y = 1; return 0; }
and it failed if the file was named test.c and it succeeded if the
file was named test.cpp.
I wonder if newer levels of Visual Studio or the compiler itself
aren't doing the right thing (or there is something in/missing from
the project file which tells it to treat everything as c++...
--
Jeff Trawick | [EMAIL PROTECTED] | PGP public key at web site:
http://www.geocities.com/SiliconValley/Park/9289/
Born in Roswell... married an alien...