Re: Turn off -Wshadow for boost::gil?
Re: Turn off -Wshadow for boost::gil?
- Subject: Re: Turn off -Wshadow for boost::gil?
- From: "Sean McBride" <email@hidden>
- Date: Fri, 8 May 2009 19:22:54 -0400
- Organization: Rogue Research Inc.
On 5/8/09 4:18 PM, Steve Mills said:
>We use boost and gil. We like having the -Wshadow warning turned on
>(Hidden Local Variables) because it shows possible bugs. But the gil
>code is jam packed with violations of this warning, so we get way over
>10,000 warnings before Xcode stops displaying them. We include some
>gil files in one of our headers. That header is included in our pch.
>
>What I'm hoping to find is a way to turn off that warning while the
>compiler is looking at the gil files, then reset it back to its former
>state. That way the warning is still useful should somebody in our
>company write bad code that hides a local/member variable. But Xcode
>(well, gcc) doesn't seem to pay attention to my attempts. This is what
>I added at the top of our .h that then includes the gil headers.
>
>#pragma GCC diagnostic ignored "-Wshadow"
>
>The warning is turned on in our project settings (in an .xcconfig file
>actually).
Your solution is correct, but alas that pragma only works for some
warnings. You'll just have to file a bug asking that they support it
for -Wshadow and then pray. My experience:
works: -Weffc++ -Wfloat-equal
doesn't: -Wshorten-64-to-32 <rdar://6280059>
Perhaps adding -Wno-shadow per file would work. But if you have many
files that need it, well...
--
____________________________________________________________
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