This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch for bug 12802
- From: "Joseph S. Myers" <jsm at polyomino dot org dot uk>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 24 Sep 2004 20:30:18 +0000 (UTC)
- Subject: Patch for bug 12802
This patch fixes bug 12802 by adding documentation of what cases of
anonymous structs/unions -fms-extensions is needed for. It passes "make
info" and "make dvi". Applied to mainline.
--
Joseph S. Myers http://www.srcf.ucam.org/~jsm28/gcc/
http://www.srcf.ucam.org/~jsm28/gcc/#c90status - status of C90 for GCC 4.0
jsm@polyomino.org.uk (personal mail)
jsm28@gcc.gnu.org (Bugzilla assignments and CCs)
2004-09-24 Joseph S. Myers <jsm@polyomino.org.uk>
PR c/12802
* doc/extend.texi (Unnamed Fields): Remove "." from end of long
title. Document interaction with -fms-extensions.
* doc/invoke.texi (-fms-extensions): Refer to Unnamed Fields
section.
diff -rupN doc.orig/extend.texi doc/extend.texi
--- doc.orig/extend.texi 2004-09-23 16:08:32.000000000 +0000
+++ doc/extend.texi 2004-09-24 20:24:15.000000000 +0000
@@ -8308,7 +8308,7 @@ multiple @code{#pragma pack(@var{n})} in
@end enumerate
@node Unnamed Fields
-@section Unnamed struct/union fields within structs/unions.
+@section Unnamed struct/union fields within structs/unions
@cindex struct
@cindex union
@@ -8348,6 +8348,15 @@ It is ambiguous which @code{a} is being
Such constructs are not supported and must be avoided. In the future,
such constructs may be detected and treated as compilation errors.
+@opindex fms-extensions
+Unless @option{-fms-extensions} is used, the unnamed field must be a
+structure or union definition without a tag (for example, @samp{struct
+@{ int a; @};}). If @option{-fms-extensions} is used, the field may
+also be a definition with a tag such as @samp{struct foo @{ int a;
+@};}, a reference to a previously defined structure or union such as
+@samp{struct foo;}, or a reference to a @code{typedef} name for a
+previously defined structure or union type.
+
@node Thread-Local
@section Thread-Local Storage
@cindex Thread-Local Storage
diff -rupN doc.orig/invoke.texi doc/invoke.texi
--- doc.orig/invoke.texi 2004-09-23 16:08:32.000000000 +0000
+++ doc/invoke.texi 2004-09-24 20:15:38.000000000 +0000
@@ -1223,6 +1223,10 @@ freestanding and hosted environments.
@opindex fms-extensions
Accept some non-standard constructs used in Microsoft header files.
+Some cases of unnamed fields in structures and unions are only
+accepted with this option. @xref{Unnamed Fields,,Unnamed struct/union
+fields within structs/unions}, for details.
+
@item -trigraphs
@opindex trigraphs
Support ISO C trigraphs. The @option{-ansi} option (and @option{-std}