This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH]: Fix problematic -Wcast-qual cases using new CONST_CAST macro


Kaveh R. GHAZI wrote:

> In light of this, I'd like permission to install my existing patch.  If
> someone can suggest a better definition for CONST_CAST() and/or write an
> inline function to replace it, it's merely a one-line change to system.h
> as a follow-up.  Until then, the union hack is the only thing I can think
> of that actually does the job.

I think it's pretty ugly.  Is this what we want our users to do when
they have the same issue?

Until we provide some way to turn off warnings in a local region of
code, I'd rather we just accept that we can't be quite -Wcast-qual
clean.  Use it as an incentive to fix the compiler, either to make the
warning smarter (by, for example, allowing casts in the argument to
"free", or by allowing fine-grained warning control).

I'm not going to reject the patch, but I'm not going to approve it
either.  Color me abstaining. :-)

Thanks,

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]