Author: David Rasmussen
Date: 03:03:14 12/08/01
Go up one level in this thread
On December 08, 2001 at 04:16:46, Lex Loep wrote: >Altough a bit off topic I still post it as many here use the MSVC compiler. >This bug makes me feel a bit uneasy as this is just a simple constuction >and makes you wander how many more of these faults are in there. > >Lex > There are no compilers without bugs. I have found a bunch in various versions of gcc myself. In fact, I have discovered fewer compiler bugs in MSVC than in gcc, but that may just be a coincidence. On the other hand, neither of those two compilers are very standard compliant, and that may be viewed as a bug in itself. The gcc 3.0.x branch is far more standard compliant than older gcc's, but not too compliant yet, and also, it is quite unstable yet. MSVC7 is also far more compliant than earlier versions. > >When compiling the code fragment below with optimization for minimum size >the wrong code is produced. > >The Good and Bad function should return the same result (0x11000) >but does not, Bad returns 0. Works fine in debug builds. >VS6SP5 > As far as I can see, you have found a genuine compiler bug in MSVC6. The problem is not there in MSVC7 (Visual Studio .NET), I can tell you. >// compilerbug.cpp : Defines the entry point for the console application. >// > >#include <stdio.h> >#include <conio.h> > > Why do you call the file compilerbug.cpp and make the compiler use it's c++ frontend, rather than just compilerbug.c, which would make the compiler use another frontend? After all, this code is C, not C++ (#include "stdio.h" instead of #include <cstdio>, printf etc.) Of course this code (as far as I can tell) should still work in C++, but anyways... /David
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.