develooper Front page | perl.perl5.porters | Postings from November 2016

Re: [perl #130169] Fix const correctness for header files

Thread Previous | Thread Next
Petr Pisar
November 25, 2016 13:04
Re: [perl #130169] Fix const correctness for header files
Message ID:
On Thu, Nov 24, 2016 at 01:05:58PM -0800, Zefram via RT wrote:
> Indeed.  We're not going to want to change prototypes here, for the same
> reasons that the strchr() prototype is appropriate as it is.  The code
> is correct, and there's no reasonable way to avoid these warnings.
I searched Perl sources to see how utf8_hop is used and it's realy mix of all
the ways.

Should I bother with compiler pragmata to silent the warning? GCC-specific
code would be:

	char *foo(const char *a) {
	#if defined __GNUC__
	#pragma GCC diagnostic push
	#pragma GCC diagnostic ignored "-Wcast-qual"
		return (char *)a;
	#if defined __GNUC__
	#pragma GCC diagnostic pop

I do not want to clutter the sources. 

> Your first two patches seem OK.  We're happy with that kind of localised
> change to avoid warnings.
Thanks for reviewing the patches.

-- Petr

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About