Re: Disable Compiler Waring
- From: Ashutosh <smbs-msdn@xxxxxxxxxxxxx>
- Date: Tue, 27 May 2008 16:25:27 +0530
HI Ulrich,
I don't have to worry about compiling my code in other compiler. But I like your idea of putting/enclosing the enum declaration in a namespace.
Thanks & Regards,
Ashutosh
Ulrich Eckhardt wrote:
Ashutosh Bhawasinka wrote:.I want to disable compiler warning C4482 (nonstandard extension used:
enum 'enum' used in qualified name)
Fix the code:
enum foo { bar };
// wrong
foo f = foo::bar;
// correct
foo f = bar;
Enumeration constants 'leak' into the surrounding namespace. If you don't
want that, enclose the enumeration itself in a namespace:
namespace foo {
enum type { bar };
}
foo::type f = foo::bar;
Secondly, will this have any effect on the project?
Disabling or ignoring warning doesn't directly affect the outcome, but in
general warnings are a sign of low code quality. Your code above is simply
not portable to other compilers that don't support this extension.
Fix it, it's broken.
Uli
- References:
- Disable Compiler Waring
- From: Ashutosh Bhawasinka
- Re: Disable Compiler Waring
- From: Ulrich Eckhardt
- Disable Compiler Waring
- Prev by Date: Unable to debug a DLL
- Next by Date: Re: Unable to debug a DLL
- Previous by thread: Re: Disable Compiler Waring
- Next by thread: Re: Disable Compiler Waring
- Index(es):
Relevant Pages
|