Re: how to get signed/unsigned comparison warning with CLANG (and get rid of a spurious ; warning)
Re: how to get signed/unsigned comparison warning with CLANG (and get rid of a spurious ; warning)
- Subject: Re: how to get signed/unsigned comparison warning with CLANG (and get rid of a spurious ; warning)
- From: "Sean McBride" <email@hidden>
- Date: Wed, 23 Dec 2009 10:28:31 -0500
- Organization: Rogue Research Inc.
On 12/23/09 9:37 PM, Roland King said:
>I blew myself up with this piece of code
>
> NSUInteger length;
> // ...
> if( length < 0 )
> // ....
>
>because of course length is unsigned.
>
>with gcc I have -Wextra and -Wtype-limits and it catches it, but I've
>been building for OS X using CLANG and it doesn't warn me even with
>those two specified so I missed this bug. I have a lot of the other
>warning selection boxes checked also but .. I can't make this warning
>come up. What do I need to get this warning with CLANG?
clang is missing a lot of warnings that gcc has. You found another I
guess. Also, the clang in Xcode 3.2 is pretty old by now, you could try
a newer one if you're brave. Maybe the static analyzer could warn about
this case though, did you try it?
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden