• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
how to get signed/unsigned comparison warning with CLANG (and get rid of a spurious ; warning)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

how to get signed/unsigned comparison warning with CLANG (and get rid of a spurious ; warning)


  • Subject: how to get signed/unsigned comparison warning with CLANG (and get rid of a spurious ; warning)
  • From: Roland King <email@hidden>
  • Date: Wed, 23 Dec 2009 21:37:16 +0800

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?

Also if I have 'pedantic' warnings enabled with CLANG I get the following warning on the following line of code

@synthesize myvar;			// Extra ; outside of a function

but if I remove the ; of course it fails to compile. Is there something I'm doing wrong there?  _______________________________________________
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

  • Follow-Ups:
    • Re: how to get signed/unsigned comparison warning with CLANG (and get rid of a spurious ; warning)
      • From: "Sean McBride" <email@hidden>
  • Prev by Date: Running a Build Phase as Root
  • Next by Date: Re: Utilizing OTHER_CFLAGS properly?
  • Previous by thread: Re: Running a Build Phase as Root
  • Next by thread: Re: how to get signed/unsigned comparison warning with CLANG (and get rid of a spurious ; warning)
  • Index(es):
    • Date
    • Thread