freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft-devel] [freetype2] master fc11af1: Various minor clang fixes.


From: suzuki toshiya
Subject: Re: [ft-devel] [freetype2] master fc11af1: Various minor clang fixes.
Date: Thu, 21 Jan 2016 00:10:21 +0900
User-agent: Mozilla-Thunderbird 2.0.0.24 (X11/20100329)

Sorry for lated response about this issue.

Yes, about this case, I agree with the removal of redundant
default case after the complete list of possible enum values.

The variable, gxvalid->statetable.entry_glyphoffset_fmt,
it is set by gxv module internally not imported from external
font file (thus, malicious input data cannot set the value to
the undefined value). So it is OK to remove the default case.

Regards,
mpsuzuki

Werner LEMBERG wrote:
>>> The `default' case is redundant, since all possible enum values are
>>> covered in the `switch' statement.
>> I personally prefer having code in front of me that I can prove
>> correct, than having to go fish for all the places that value in the
>> switch statement is set to convince myself that it can't possibly
>> have any other value...
> 
> Well, I've commented this code out to fix a clang warning...  Today,
> compilers tell you reliably whether a `default' label is redundant or
> missing, so I consider your constraints as a non-issue.
> 
>> At any rate, having "#if 0" code like this is not a good idea as 5
>> years from now no one will remember why that code is there and why
>> it's disabled.
> 
> True.
> 
> 
>     Werner



reply via email to

[Prev in Thread] Current Thread [Next in Thread]