1439             default: {
1440                /* There should be a way for the compiler to check this. */
1441                 bool once =3D false;
>>>     CID 435753:  Possible Control flow issues  (DEADCODE)
>>>     Execution cannot reach this statement: "return;". =20
1442                 if (once) return;          /* Avoid log file DDoS */

That's some of my new code.

In this case, I'm switching on a enum and have handled all the cases so the 
default "can't happen".

How do I get the compiler to tell me if I missed an option on a switch 
statement?

Of course, the data might get mashed, so the other question is:
  How do I get coverty to not complain about this code?



-- 
These are my opinions.  I hate spam.



_______________________________________________
devel mailing list
devel@ntpsec.org
https://lists.ntpsec.org/mailman/listinfo/devel

Reply via email to