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 goto *expr for non-pointer expr (PR c++/38725)


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


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