Re: Strangest VC8 bug yet



Sean M. DonCarlos wrote:
"Edward Diener" wrote:

I have a source file [..]
The most amazing thing about this error is that the error message shows that an extra 's' has been added to the
name of the class in the error message, so that using the example
above the error message would be:

error C3083: 'SomeClasss': the symbol to the left of a '::' must be a
type
[..]
Please post the minimal amount of code, complete, so we could also try
it on our systems, and so you have something to post as an example when
you submit a bug report to MS.
If I try to reduce the code by removing lines which would ordinarily not be included anyway because of preprocessor #if commands, the bug goes away. The source is being used by more than one version of VC++ and I have preprocessor commands like:

#if defined(_MSC_VER) && _MSC_VER < 1300
// some code or header file include
#endif

The only thing that I have seen change a type's name in the middle of a translation unit is a preprocessor macro run amok. Since you are using conditional compilation based on the compiler version, you might be using macros to handle constructs valid in one version and not the other.

If you had a macro that only was defined for VC8, and it managed to get "SomeClass" on one side of a ## operator and "s" on the other...

Try compiling the troublesome source with /P (Generate Preprocessed File), open the *.i file generated, and see if you get "SomeClass" or "SomeClasss".

I tried this, looking at the preprocessor output, but I still get the equivalent of "SomeClass", not "SomeClasss" in the output.

I reported this bug to Microsoft at http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=785bbfc9-57a4-4d6b-a606-65aa905761bb .

I have found a workaround, which is to create a completely separate version of the source/header file combination only for VC8, which means that I have no #if or #if defined(...) statements in either file.

This now ranks as the oddest bug I have found for VC8, but I am worried that there is a more serious bug in the compiler which greats triggered somehow because of certain conditions which exist in my original files. Eventually MS will test out my bug report and perhaps tell me what is going on, but I have to continue on in my own development in the meantime.

At least MS actually looks at the bug reports and tries to verify them, and eventually fix them. I reported bugs in the past to Borland which they had completely ignored for many years, some of which they have still never looked at. It is a much better feeling when a company actually wants to fix bugs.
.



Relevant Pages