[cfe-commits] r138510 - /cfe/trunk/lib/StaticAnalyzer/Core/CFRefCount.cpp
Jordy Rose
jediknil at belkadan.com
Wed Aug 24 16:37:06 PDT 2011
Ah, good point. I was annoyed at GCC /not/ handling this and didn't think of the best fix.
On Aug 24, 2011, at 16:23, Ted Kremenek wrote:
> Hi Jordy,
>
> Do we need to add another 'default' case here? Doesn't that defeat the checking by the compiler that all enums of the switch statement is enumerated? Can't we just put the llvm_unreachable() after the switch statement?
>
> On Aug 24, 2011, at 3:58 PM, Jordy Rose wrote:
>
>> Author: jrose
>> Date: Wed Aug 24 17:58:49 2011
>> New Revision: 138510
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=138510&view=rev
>> Log:
>> [analyzer] Silence another incorrect warning ("control reaches end of non-void function")
>>
>> Modified:
>> cfe/trunk/lib/StaticAnalyzer/Core/CFRefCount.cpp
>>
>> Modified: cfe/trunk/lib/StaticAnalyzer/Core/CFRefCount.cpp
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/CFRefCount.cpp?rev=138510&r1=138509&r2=138510&view=diff
>> ==============================================================================
>> --- cfe/trunk/lib/StaticAnalyzer/Core/CFRefCount.cpp (original)
>> +++ cfe/trunk/lib/StaticAnalyzer/Core/CFRefCount.cpp Wed Aug 24 17:58:49 2011
>> @@ -2700,6 +2700,9 @@
>> return false;
>> case LangOptions::GCOnly:
>> return true;
>> + default:
>> + llvm_unreachable("Invalid/unknown GC mode.");
>> + return false;
>> }
>> }
>>
>>
>>
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
More information about the cfe-commits
mailing list