This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] pedantic warning behavior when casting void* to ptr-to-func, 4.8 and 4.9
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Daniel Gutson <daniel dot gutson at tallertechnologies dot com>
- Cc: gcc Mailing List <gcc at gcc dot gnu dot org>
- Date: Tue, 1 Apr 2014 19:52:34 +0100
- Subject: Re: [PATCH] pedantic warning behavior when casting void* to ptr-to-func, 4.8 and 4.9
- Authentication-results: sourceware.org; auth=none
- References: <CAF5HaEVzxmXnzEuW6ZCDXxTu=apqWZNM+ggoUFDQpNvun91MEw at mail dot gmail dot com> <CAH6eHdRe38C70-UfCzAvMeZ8L+eeZ9H1P2UTXWhcfCDSHiO2aQ at mail dot gmail dot com> <CAF5HaEU1+93qz1dJRbvaXG_Q3cv1rrkG6HpApOB21pw6WhAzYg at mail dot gmail dot com>
On 1 April 2014 15:00, Daniel Gutson wrote:
>> For regressions, yes, but I don't think this is a regression.
>
> Why not? (I don't know the criteria, please let me know).
Did it work in previous versions?
A regression means something that used to work no longer works.
> Upcoming Ubuntu LTS will have g++ 4.8.2, having this fixed will be
> extremely useful.
It's not up to me, but personally I'd say it's a low priority fix.
If a user doesn't want the warning then they should not use -pedantic.
If they need to use -pedantic then they shouldn't be using
conditionally-supported casts.
>>> Regarding 4.9, gcc fails to complain at all when -pedantic is passed,
>>> even specifying -std=c++03.
>>> Please let me know if this is truly a bug, in which case I could also
>>> fix it for the latest version as well
>>
>> I believe it's by design. The C++11 standard says in
>
> So what about -std=c++03 or earlier standards?
As I said, G++ has always supported it, in any standard mode.
If you don't want the warning issued by previous versions then don't
use -pedantic.
> BTW, shouldn't 4.8 be fixed accordingly for C++11 as well?
Maybe, maybe not. There's always a risk making changes to stable
releases, so new features or low priority fixes are not always
backported. This particular one might be safe, but I don't know.