From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20072 invoked by alias); 28 Mar 2014 14:38:12 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 20062 invoked by uid 89); 28 Mar 2014 14:38:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.0 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 28 Mar 2014 14:38:10 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s2SEc94b016365 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 28 Mar 2014 10:38:09 -0400 Received: from redhat.com (ovpn-116-31.ams2.redhat.com [10.36.116.31]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s2SEc6Im020572 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) for ; Fri, 28 Mar 2014 10:38:08 -0400 Date: Fri, 28 Mar 2014 14:48:00 -0000 From: Marek Polacek To: GCC Patches Subject: [DOC PATCH] Clarify docs about stmt exprs (PR c/51088) Message-ID: <20140328143805.GA4275@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2014-03/txt/msg01614.txt.bz2 PR51088 contains some Really Bizzare code. We should tell users not to do any shenanigans like that. Ok for trunk? 2014-03-28 Marek Polacek PR c/51088 * doc/extend.texi (Statement Exprs): Add note about taking addresses of labels inside of statement expressions. diff --git gcc/doc/extend.texi gcc/doc/extend.texi index f9114ab..215d0a2 100644 --- gcc/doc/extend.texi +++ gcc/doc/extend.texi @@ -206,6 +206,9 @@ Jumping into a statement expression with @code{goto} or using a @code{case} or @code{default} label inside the statement expression is not permitted. Jumping into a statement expression with a computed @code{goto} (@pxref{Labels as Values}) has undefined behavior. +Taking the address of a label declared inside of a statement +expression from outside of the statement expression has undefined +behavior. Jumping out of a statement expression is permitted, but if the statement expression is part of a larger expression then it is unspecified which other subexpressions of that expression have been Marek