Re: Per-file Warnings suppression?
Re: Per-file Warnings suppression?
- Subject: Re: Per-file Warnings suppression?
- From: Alexander von Below <email@hidden>
- Date: Wed, 01 Oct 2008 19:35:52 +0200
Am 01.10.2008 um 19:11 schrieb Brian Stern:
What would make all of this much simpler would be if gcc had a way
of turning on/off warnings and other compiler settings in the source
code. I don't think it has any way to do that. Is this a feature
that's ever been suggested for gcc? Is there any likelihood of it
ever being implemented?
I would be pretty sure it has been suggested, after all, the Microsoft
C compiler does this. It allows you to even specify warning levels on
a line-by-line basis.
The con is clear to see: While groups of developers often share code,
they sometimes do not share their build settings. Settings that are
appropriate for one target aren't necessarily appropriate for another.
Who should win? The settings in the code or in the file, target,
project settings?
I guess most users of gcc are doing makefile development. Not sure
if there's a convenient way to specify a per-file compiler setting
in a makefile or if this affects the likelihood of this feature ever
being implemented.
Well of course! Make can do pretty much everything, including the
dishes. You would simply specify the dependency for this file seperately
yourfile.o: yourfile.c $(CC) -c $(SUPERSPECIALFLAGSFORTHISFILE) $@.c
I am not sure if that meets your definition of "convenient", but then
the world "convenient" never comes to my mind when thinking about
Makefiles.
Alex
_______________________________________________
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