This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix goto *expr for non-pointer expr (PR c++/38725)
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Jason Merrill <jason at redhat dot com>, Mark Mitchell <mark at codesourcery dot com>, gcc-patches at gcc dot gnu dot org
- Date: Thu, 8 Jan 2009 18:03:16 +0000 (UTC)
- Subject: Re: [PATCH] Fix goto *expr for non-pointer expr (PR c++/38725)
- References: <20090107224710.GL25055@tyan-ft48-01.lab.bos.redhat.com>
On Wed, 7 Jan 2009, Jakub Jelinek wrote:
> Attached are 2 alternative patches, both bootstrapped/regtested on
> x86_64-linux. The first one rejects in both C and C++ FE goto *expr
> if expr doesn't have void * type, the second one just changes the C++
> FE to match C FE. Given that the rejection patch rejected 10 testcases
> in our testsuite, I'd bet there are numerous programs in the wild that would
> be bitten by the same, so I'm not sure if it is appropriate, at least
> this late in the 4.4 cycle. So perhaps the second patch might be better,
> at least for 4.4.
How many of the rejected programs were using some pointer type other than
void *?
One possibility would be to allow all pointer types and give a mandatory
diagnostic for integer types (other cases should already fail to convert
to a pointer type at all), similar to other implicit conversions to void *
(but without any warnings for loss of qualifiers, which aren't meaningful
in this case).
--
Joseph S. Myers
joseph@codesourcery.com