[fpc-devel] "Case statement does not handle all possible cases" Warning

J. Gareth Moreton gareth at moreton-family.com
Sat May 18 13:30:01 CEST 2019


Hi everyone,

So it looks like this new warning has appeared as part of the data flow 
analysis of -O4.  The thing is, I personally have a problem with this 
being a warning, because there's nothing inherently wrong with not 
covering every case branch or omitting an else block (especially if one 
isn't needed).  Adding "else ;" everywhere seems to just cause bloat.

Still, code style aside, can I suggest the warning be downgraded into a 
hint? Warnings should indicate the possibility of unstable code due to 
uninitialised values, for example, and DFA should be able to detect that 
anyway as a separate warning (e.g. if a case block doesn't initialise an 
output value in all of its branches).

Gareth aka. Kit


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus




More information about the fpc-devel mailing list