How do I inhibit "note C6311" in Microsoft C compiler?

Posted by piCookie on Stack Overflow See other posts from Stack Overflow or by piCookie
Published on 2010-04-20T16:23:14Z Indexed on 2010/04/20 16:33 UTC
Read the original article Hit count: 285

Filed under:
|
|

In this maximally clipped source example, the manifest constant FOOBAR is being redefined. This is deliberate, and there is extra code in the live case to make use of each definition.

The pragma was added to get rid of a warning message, but then a note appeared, and I don't seem to find a way to get rid of the note.

I've been able to modify this particular source to #undef between the #define, but I would like to know if there's a way to inhibit the note without requiring #undef, since there are multiple constants being handled the same way.

#pragma warning( disable : 4005 ) // 'identifier' : macro redefinition
#define FOOBAR FOO
#define FOOBAR BAR

The compiler banner and output are as follows

Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.

message.c
message.c(3) : note C6311: message.c(2) : see previous definition of 'FOOBAR'

© Stack Overflow or respective owner

Related posts about c++

Related posts about visual-c++