I want to enable warning C4061 in VC6 SP5 (for some reason, my company
isn't approving SP6), which alerts you if a switch statement on an
enumerated type doesn't handle all of the enum's members. Even in the
simplest case, it does not work for me:

---------------

#pragma warning (default : 4061)

enum prag{ALPHA, BETA, GAMMA};

void f(prag p)
{
switch(p)
{
case ALPHA :
case GAMMA :
break;
}
}

void main() {}

---------------

I have cleaned and rebuilt many times on every warning level. Does
anyone have any insight into why it isn't working? I also tried C4062
and had the same problem.

Thank you very much.

Re: #pragma ( default : 4061) not working by Bruno

Bruno
Fri Jun 23 10:53:20 CDT 2006

>I want to enable warning C4061 in VC6 SP5 (for some reason, my company
> isn't approving SP6), which alerts you if a switch statement on an
> enumerated type doesn't handle all of the enum's members. Even in the
> simplest case, it does not work for me:
>
> ---------------
>
> #pragma warning (default : 4061)

#pragma warning (error: 4061)
does what you want (at least in vc2005)

also, did you compile with /Wall ?

--

Kind regards,
Bruno van Dooren
bruno_nos_pam_van_dooren@hotmail.com
Remove only "_nos_pam"



Re: #pragma ( default : 4061) not working by Hobbes

Hobbes
Fri Jun 23 11:22:16 CDT 2006


Bruno van Dooren wrote:
> #pragma warning (error: 4061)
> does what you want (at least in vc2005)

VC6 accepts that, but it has the same effect, i.e. none at all.

> also, did you compile with /Wall ?

I tried that, but I get:
Command line error D2021 : invalid numeric argument '/Wall'