This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

C99 TC2 patch


C99 TC2 has been published; the effect on GCC is that the handling of 
padding after flexible array members is now OK and c99-flex-array-4.c 
(XFAILed) should be removed.  This patch passes "make info" and "make 
dvi".  Applied to mainline.

Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ChangeLog,v
retrieving revision 2.6656
diff -u -r2.6656 ChangeLog
--- ChangeLog	1 Dec 2004 00:32:31 -0000	2.6656
+++ ChangeLog	1 Dec 2004 01:55:53 -0000
@@ -1,3 +1,7 @@
+2004-12-01  Joseph S. Myers  <joseph@codesourcery.com>
+
+	* doc/standards.texi: Update for C99 TC2.
+
 2004-11-30  Jeff Law  <law@redhat.com>
 
 	* sbitmap.c (sbitmap_any_common_bits): New function.
Index: doc/standards.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/standards.texi,v
retrieving revision 1.17
diff -u -r1.17 standards.texi
--- doc/standards.texi	5 Nov 2004 01:36:57 -0000	1.17
+++ doc/standards.texi	1 Dec 2004 01:55:53 -0000
@@ -84,8 +84,8 @@
 development, drafts of this standard version were referred to as
 @dfn{C9X}.)
 
-Errors in the 1999 ISO C standard were corrected in a Technical
-Corrigendum published in 2001.  GCC does not support the uncorrected
+Errors in the 1999 ISO C standard were corrected in two Technical
+Corrigenda published in 2001 and 2004.  GCC does not support the uncorrected
 version.
 
 By default, GCC provides some extensions to the C language that on
Index: testsuite/ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/ChangeLog,v
retrieving revision 1.4696
diff -u -r1.4696 ChangeLog
--- testsuite/ChangeLog	30 Nov 2004 21:37:12 -0000	1.4696
+++ testsuite/ChangeLog	1 Dec 2004 01:55:59 -0000
@@ -1,3 +1,7 @@
+2004-12-01  Joseph S. Myers  <joseph@codesourcery.com>
+
+	* gcc.dg/c99-flex-array-4.c: Remove.
+
 2004-11-30  Janis Johnson  <janis187@us.ibm.com>
 
 	* lib/compat.exp (compat-get-options): Fix for use with dg-xfail-if.
Index: testsuite/gcc.dg/c99-flex-array-4.c
===================================================================
RCS file: testsuite/gcc.dg/c99-flex-array-4.c
diff -N testsuite/gcc.dg/c99-flex-array-4.c
--- testsuite/gcc.dg/c99-flex-array-4.c	3 Sep 2004 17:22:40 -0000	1.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,27 +0,0 @@
-/* Test for flexible array members.  Test for agreement of offset and
-   structure size.  This is expected to fail, because of a possible
-   defect in the standard.  */
-/* Origin: http://gcc.gnu.org/ml/gcc/2002-05/msg02844.html
-   from Tony Finch <dot@dotat.at>, adapted to a testcase by Joseph Myers
-   <jsm28@cam.ac.uk>.  See also WG14 reflector messages 9571-3.  */
-/* { dg-do compile } */
-/* -fpack-struct is necessary because the code below assumes the initial
-   packing is larger than 1, which cannot ge guaranteed for all targets. */
-/* { dg-options "-std=iso9899:1999 -fpack-struct=8 -pedantic-errors" } */
-
-#include <stddef.h>
-
-struct foo {
-  int a;
-  short b;
-  char pad[];
-};
-
-struct bar {
-  int a;
-  short b;
-  char pad[1024];
-};
-
-char x[(sizeof(struct foo) == offsetof(struct foo, pad)) ? 1 : -1]; /* { dg-bogus "negative" "sizeof != offsetof" { xfail *-*-* } } */
-char y[(offsetof(struct foo, pad) == offsetof(struct bar, pad)) ? 1 : -1];
Index: c99status.html
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/c99status.html,v
retrieving revision 1.39
diff -u -r1.39 c99status.html
--- c99status.html	29 Jun 2004 19:54:29 -0000	1.39
+++ c99status.html	1 Dec 2004 02:00:17 -0000
@@ -9,7 +9,7 @@
 
 <p>This table is based on the list in the foreword to the printed
 standard ISO/IEC 9899:1999 (E), as amended by ISO/IEC
-9899:1999/Cor.1:2001 (E).</p>
+9899:1999/Cor.1:2001 (E) and ISO/IEC 9899:1999/Cor.2:2004 (E).</p>
 
 <p>Where "Library Issue" is listed in conjunction with some other
 status, this means that some compiler support is needed for the
@@ -344,11 +344,6 @@
 <li><code>const</code>-qualified compound literals could share storage
 with each other and with string literals, but currently don't.</li>
 
-<li>The size of structures with flexible array members is <a
-href="http://gcc.gnu.org/ml/gcc/2002-05/msg02844.html";>not as
-specified in C99</a>; this may be a defect in C99 and other
-implementations behave the same way as GCC.</li>
-
 <li>The information provided by <code>static</code> in parameter array
 declarators is not used for optimization.  It might make sense to use
 it in future in conjunction with <a href="projects/prefetch.html">work

-- 
Joseph S. Myers               http://www.srcf.ucam.org/~jsm28/gcc/
    jsm@polyomino.org.uk (personal mail)
    joseph@codesourcery.com (CodeSourcery mail)
    jsm28@gcc.gnu.org (Bugzilla assignments and CCs)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]