* [PING C++] Move empty-if warning to the front-end
@ 2008-09-09 6:18 Paolo Bonzini
2008-09-27 5:52 ` Mark Mitchell
2008-09-30 15:52 ` H.J. Lu
0 siblings, 2 replies; 7+ messages in thread
From: Paolo Bonzini @ 2008-09-09 6:18 UTC (permalink / raw)
To: gcc-patches
This patch from stage1:
http://permalink.gmane.org/gmane.comp.gcc.patches/170041
needs C++ maintainer approval. It allows to avoid a hack in the removal
of CONVERT_EXPR, by avoiding that NOP_EXPR<void>(0) and
CONVERT_EXPR<void>(0) have different meaning.
Paolo
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PING C++] Move empty-if warning to the front-end
2008-09-09 6:18 [PING C++] Move empty-if warning to the front-end Paolo Bonzini
@ 2008-09-27 5:52 ` Mark Mitchell
2008-09-27 9:21 ` Paolo Bonzini
2008-09-30 15:52 ` H.J. Lu
1 sibling, 1 reply; 7+ messages in thread
From: Mark Mitchell @ 2008-09-27 5:52 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: gcc-patches
Paolo Bonzini wrote:
> This patch from stage1:
>
> http://permalink.gmane.org/gmane.comp.gcc.patches/170041
>
> needs C++ maintainer approval. It allows to avoid a hack in the removal
> of CONVERT_EXPR, by avoiding that NOP_EXPR<void>(0) and
> CONVERT_EXPR<void>(0) have different meaning.
This is conceptually OK. But, I would like to understand why you've
duplicate the code for both the if and else clauses, and also why that
code isn't exactly the same, other than the literal word "if" and "else".
Thanks,
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PING C++] Move empty-if warning to the front-end
2008-09-27 5:52 ` Mark Mitchell
@ 2008-09-27 9:21 ` Paolo Bonzini
2008-09-28 21:22 ` Mark Mitchell
0 siblings, 1 reply; 7+ messages in thread
From: Paolo Bonzini @ 2008-09-27 9:21 UTC (permalink / raw)
To: Mark Mitchell; +Cc: gcc-patches
Mark Mitchell wrote:
> Paolo Bonzini wrote:
>> This patch from stage1:
>>
>> http://permalink.gmane.org/gmane.comp.gcc.patches/170041
>>
>> needs C++ maintainer approval. It allows to avoid a hack in the removal
>> of CONVERT_EXPR, by avoiding that NOP_EXPR<void>(0) and
>> CONVERT_EXPR<void>(0) have different meaning.
>
> This is conceptually OK. But, I would like to understand why you've
> duplicate the code for both the if and else clauses, and also why that
> code isn't exactly the same, other than the literal word "if" and "else".
Because the testcase says
if (x)
; /* By design we don't warn in this case. */
else
(void)0;
if (x)
(void)0;
else
; /* { dg-warning "suggest braces around empty body in an" } */
and this causes all the differences you spotted.
Thanks for the review!
Paolo
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PING C++] Move empty-if warning to the front-end
2008-09-27 9:21 ` Paolo Bonzini
@ 2008-09-28 21:22 ` Mark Mitchell
0 siblings, 0 replies; 7+ messages in thread
From: Mark Mitchell @ 2008-09-28 21:22 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: gcc-patches
Paolo Bonzini wrote:
> Because the testcase says
>
> if (x)
> ; /* By design we don't warn in this case. */
> else
> (void)0;
>
> if (x)
> (void)0;
> else
> ; /* { dg-warning "suggest braces around empty body in an" } */
>
> and this causes all the differences you spotted.
All right. I'm not sure that's how I would design the warning, but
that's an orthogonal issue. Go ahead with the patch.
Thanks,
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PING C++] Move empty-if warning to the front-end
2008-09-09 6:18 [PING C++] Move empty-if warning to the front-end Paolo Bonzini
2008-09-27 5:52 ` Mark Mitchell
@ 2008-09-30 15:52 ` H.J. Lu
1 sibling, 0 replies; 7+ messages in thread
From: H.J. Lu @ 2008-09-30 15:52 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: gcc-patches
On Mon, Sep 8, 2008 at 10:41 PM, Paolo Bonzini <bonzini@gnu.org> wrote:
> This patch from stage1:
>
> http://permalink.gmane.org/gmane.comp.gcc.patches/170041
>
> needs C++ maintainer approval. It allows to avoid a hack in the removal
> of CONVERT_EXPR, by avoiding that NOP_EXPR<void>(0) and
> CONVERT_EXPR<void>(0) have different meaning.
>
Hi,
This patch caused:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37683
--
H.J.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PING C++] Move empty-if warning to the front-end
2008-08-30 14:20 ` [PING C++] Move empty-if warning to the front-end Paolo Bonzini
@ 2008-08-30 14:46 ` Paolo Bonzini
0 siblings, 0 replies; 7+ messages in thread
From: Paolo Bonzini @ 2008-08-30 14:46 UTC (permalink / raw)
To: gcc-patches
Cc: Joseph S. Myers, Manuel López-Ibáñez,
Gcc Patch List, Andrew Pinski
This patch:
http://permalink.gmane.org/gmane.comp.gcc.patches/170041
needs C++ maintainer approval. It allows to avoid a hack in the removal
of CONVERT_EXPR, by avoiding that NOP_EXPR<void>(0) and
CONVERT_EXPR<void>(0) have different meaning.
Paolo
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PING C++] Move empty-if warning to the front-end
2008-08-30 8:43 ` Mark Mitchell
@ 2008-08-30 14:20 ` Paolo Bonzini
2008-08-30 14:46 ` Paolo Bonzini
0 siblings, 1 reply; 7+ messages in thread
From: Paolo Bonzini @ 2008-08-30 14:20 UTC (permalink / raw)
To: Mark Mitchell
Cc: Joseph S. Myers, Manuel López-Ibáñez,
Gcc Patch List, Andrew Pinski
This patch:
http://permalink.gmane.org/gmane.comp.gcc.patches/170041
needs C++ maintainer approval. It allows to avoid a hack in the removal
of CONVERT_EXPR, by avoiding that NOP_EXPR<void>(0) and
CONVERT_EXPR<void>(0) have different meaning.
Paolo
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2008-09-30 14:19 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-09 6:18 [PING C++] Move empty-if warning to the front-end Paolo Bonzini
2008-09-27 5:52 ` Mark Mitchell
2008-09-27 9:21 ` Paolo Bonzini
2008-09-28 21:22 ` Mark Mitchell
2008-09-30 15:52 ` H.J. Lu
-- strict thread matches above, loose matches on Subject: below --
2008-08-29 16:24 PR 18050 -Wsequence-point reports false positives Manuel López-Ibáñez
2008-08-30 8:11 ` Joseph S. Myers
2008-08-30 8:43 ` Mark Mitchell
2008-08-30 14:20 ` [PING C++] Move empty-if warning to the front-end Paolo Bonzini
2008-08-30 14:46 ` Paolo Bonzini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).