[PATCH] C99 designated initializers (take 2)

Joseph S. Myers jsm28@cam.ac.uk
Tue Dec 5 13:57:00 GMT 2000


On Tue, 5 Dec 2000, Jakub Jelinek wrote:

> +side-effect, it is undefined whether the side-effect happen or not.
                      ^^^^^^^^^                         ^^^^^^
                      unspecified                       happens

> +/* Test for C99 designated initializer errors */

Previous comments on the testcases still apply:

* Should have a test for the warning for overridden initializers with side
effects.

* Should have a test for the constraint of 6.7.8p2 (a designator givin too
large an array index).

* Should check that errors are hard errors, not warnings.  (If a Dejagnu
expert could add this functionality to Dejagnu - to assert that a
diagnostic must not say "warning", e.g. dg-hard-error - it would help
clean up a lot of the tests.)

* Should have a test c90-init-1.c that -std=iso9899:1990 -pedantic-errors
causes uses of designated initializers to give hard errors.

* Should have a test that initializing ranges and the obsolete GNU syntax
give errors with -std=c99 -pedantic-errors.

> --- gcc/testsuite/gcc.dg/c99-init-3.c.jj	Tue Dec  5 16:18:58 2000
> +++ gcc/testsuite/gcc.dg/c99-init-3.c	Tue Dec  5 16:48:36 2000
> @@ -0,0 +1,62 @@
> +/* Test for C99 designated initializers */
> +/* Origin: Jakub Jelinek <jakub@redhat.com> */
> +/* { dg-do run } */
> +/* { dg-options "-std=gnu99" } */

As this is a test of GNU extended functionality, it should have some other
name than c99-init-3.c (e.g. gnu99-init-1.c).

-- 
Joseph S. Myers
jsm28@cam.ac.uk



More information about the Gcc-patches mailing list