[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ft-devel] [freetype2] master fc11af1: Various minor clang fixes.
From: |
Sean McBride |
Subject: |
Re: [ft-devel] [freetype2] master fc11af1: Various minor clang fixes. |
Date: |
Wed, 20 Jan 2016 12:19:19 -0500 |
On Wed, 20 Jan 2016 13:36:06 +0100, Werner LEMBERG said:
>
>>> 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.
Note that you can also use -fsanitize=enum to catch at runtime invalid values
in your enum variables too:
<http://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html>
Cheers,
--
____________________________________________________________
Sean McBride, B. Eng address@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada