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

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

Thread Previous | Thread Next
From:
Petr Pisar
Date:
November 25, 2016 13:04
Subject:
Re: [perl #130169] Fix const correctness for header files
Message ID:
20161125130330.GI2333@dhcp-0-146.brq.redhat.com
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"
	#endif
		return (char *)a;
	#if defined __GNUC__
	#pragma GCC diagnostic pop
	#endif
	}

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


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About