On Sat, Jan 26, 2002 at 10:45:02PM +0000, Simon Cozens wrote: > On Sat, Jan 26, 2002 at 10:17:12PM +0000, Nicholas Clark wrote: > > But I can't see a way to tell gcc that we want to do this and locally > > no warnings 'cast-qual'; (if you see what I mean) > > There don't seem to be pragmata to do this, and I can't spot an obvious > > construction to launder away the const-ness. > > It's fine. Warnings are there to help us; we're not supposed to be a slave > to them.
I'm in two minds here. Whilst I agree with you about not being a slave to warning, I also would like the compiling to have no warnings, so that any that crop up as a result of code change are worth paying attention to. Warnings that warn and get ignored are "crying wolf", and that feels bad to me. My irritation is that generally the cast-qual warning is useful for spotting something that may be dodgy, but I can find no way of telling gcc "I know that this bit of code violates the warning, so shut up about this warning just here". I *really* don't want us accepting a position where we have warnings emitted that we "oh, don't worry about that one - that's normal". I'd rather have cast-qual turned off for the specific file, than turned on and crying wolf. (But even that will be fiddly in the makefile, and means commenting the makefile as to why it is there, and the C source as to what's special in the makefile) If we know that there are no warnings, then we can say "there should be no warnings - if you see a warning then it's worth checking out why, as something may be wrong". If we know that there are going to be warnings from our *self-imposed* compiler flags then it blunts our message - we'll have to say "ignore these warnings" and then people may ignore other real warnings telling us something else is going wrong, or people won't read the ignore list and then report warnings we already know about. Nicholas Clark -- ENOCHOCOLATE http://www.ccl4.org/~nick/CV.html