This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[DOC PATCH] Clarify docs about stmt exprs (PR c/51088)
- From: Marek Polacek <polacek at redhat dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 28 Mar 2014 15:38:05 +0100
- Subject: [DOC PATCH] Clarify docs about stmt exprs (PR c/51088)
- Authentication-results: sourceware.org; auth=none
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 <polacek@redhat.com>
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