Re: [RFC PATCH] -Wsizeof-pointer-memaccess warning

2012-08-15 Thread Joseph S. Myers
On Wed, 18 Jul 2012, Jakub Jelinek wrote: + if (warn_sizeof_pointer_memaccess +sizeof_arg != NULL_TREE) + sizeof_pointer_memaccess_warning (c_last_sizeof_arg_loc, + expr.value, exprlist, +

Re: [RFC PATCH] -Wsizeof-pointer-memaccess warning

2012-08-15 Thread Jakub Jelinek
On Wed, Aug 15, 2012 at 03:39:29PM +, Joseph S. Myers wrote: On Wed, 18 Jul 2012, Jakub Jelinek wrote: + if (warn_sizeof_pointer_memaccess + sizeof_arg != NULL_TREE) + sizeof_pointer_memaccess_warning (c_last_sizeof_arg_loc, +

Re: [RFC PATCH] -Wsizeof-pointer-memaccess warning

2012-08-15 Thread Joseph S. Myers
On Wed, 15 Aug 2012, Jakub Jelinek wrote: I was mainly interested in whether such an approach is acceptable, or whether I need to stop evaluating sizeof right away, create SIZEOF_EXPR and only fold it during fully_fold*. I've briefly looked at that today, The approach is fine. Delaying

Re: [RFC PATCH] -Wsizeof-pointer-memaccess warning

2012-07-19 Thread Paolo Carlini
Hi, On 07/18/2012 02:40 PM, Jakub Jelinek wrote: The problem on the GCC side is that both the C and C++ FEs fold away the sizeof too early (well, C++ FE only when not in a template, otherwise SIZEOF_EXPR is created and guess one could tsubst its argument again). I've only done C FE right now,

Re: [RFC PATCH] -Wsizeof-pointer-memaccess warning

2012-07-19 Thread Jakub Jelinek
On Thu, Jul 19, 2012 at 12:47:21PM +0200, Paolo Carlini wrote: On 07/18/2012 02:40 PM, Jakub Jelinek wrote: The problem on the GCC side is that both the C and C++ FEs fold away the sizeof too early (well, C++ FE only when not in a template, otherwise SIZEOF_EXPR is created and guess one could

Re: [RFC PATCH] -Wsizeof-pointer-memaccess warning

2012-07-19 Thread Paolo Carlini
Hi, On 07/19/2012 03:16 PM, Jakub Jelinek wrote: Also the c-family/ part of it, or just the c/ part? The latter I admit is not very nice (another ugliness is that we want the parameters before doing standard argument promotions on them). The latter, the latter. Unrelated, but I can't