From patchwork Fri Mar 28 14:38:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Polacek X-Patchwork-Id: 334713 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 5EF39140092 for ; Sat, 29 Mar 2014 01:38:19 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=S3f927bxyxiMyHptmRgghAA1ENIqU9jWUsdSnH/EtLKY8e83utkGY BFvA9Ji6rTg7qABBJT77rxyWgvyZTe8iGc2vSNk4usRt+GMZI2InJKCCIA0MHGtj X6EC21mkinPbWxLA8jOu13JjX/cjvD7+mK7NRr5M+AIDaoi3WAfAtU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=FqKXcKzwamTU70W2KGuPFJ3oRE8=; b=mzLOzSooU5kd/joSveKd oD/53AAXkFc/4yBSyFmxZs0QL01MIl5y1eY7Al0PtTr154OgskHzoD6HuZHSMKTF ahdP72wKMwjEwRmmX90flOzzJJedoJ52vPD6BxwYW2DEfvyX+f6NeEXdUCRsGez5 4o+OFEaMf2NjYx1BphucnDk= 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-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@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 15:38:05 +0100 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-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) 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. Marek 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