aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorKelley Cook <kelleycook@wideopenwest.com>2003-10-02 00:07:50 +0000
committerR. Kelley Cook <kcook@gcc.gnu.org>2003-10-02 00:07:50 +0000
commit2409cb3750cf2392184f599b122c9ccc0c0fb26d (patch)
treebf55ce4fc81d664fb6f366792795485791f3ccf7 /gcc
parent9a032f82ee303b06445760c2a3821d0038e91d59 (diff)
downloadgcc-2409cb3750cf2392184f599b122c9ccc0c0fb26d.zip
gcc-2409cb3750cf2392184f599b122c9ccc0c0fb26d.tar.gz
gcc-2409cb3750cf2392184f599b122c9ccc0c0fb26d.tar.bz2
/tmp/cvs001644
From-SVN: r72005
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/c-parse.in5
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/Wold-style-definition-2.c10
-rw-r--r--gcc/testsuite/gcc.dg/wtr-func-def-1.c8
5 files changed, 28 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5dbe87f..ce865fe 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2003-10-01 Kelley Cook <kelleycook@wideopenwest.com>
+
+ PR C/12466
+ * c-parse.in (parmlist_2): Mark declaration with an ellipsis as ISO C.
+
2003-10-01 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* config/mips/xm-iris5.h: Remove, unnecessary.
diff --git a/gcc/c-parse.in b/gcc/c-parse.in
index 2d3eef8..0ae20c1 100644
--- a/gcc/c-parse.in
+++ b/gcc/c-parse.in
@@ -2561,13 +2561,16 @@ parmlist_2: /* empty */
tries to verify that BUILT_IN_NEXT_ARG is being used
correctly. */
error ("ISO C requires a named argument before `...'");
+ parsing_iso_function_signature = true;
}
| parms
{ $$ = get_parm_info (1);
parsing_iso_function_signature = true;
}
| parms ',' ELLIPSIS
- { $$ = get_parm_info (0); }
+ { $$ = get_parm_info (0);
+ parsing_iso_function_signature = true;
+ }
;
parms:
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 8a6a257..69a716e 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2003-10-01 Kelley Cook <kelleycook@wideopenwest.com>
+
+ * gcc.dg/Wold-style-definition-2.c: New testcase.
+ * gcc.dg/wtr-func-def-1.c: Modify to reflect new warning.
+
2003-09-29 Richard Henderson <rth@redhat.com>
* g++.dg/init/array10.C: Add dg-options.
diff --git a/gcc/testsuite/gcc.dg/Wold-style-definition-2.c b/gcc/testsuite/gcc.dg/Wold-style-definition-2.c
new file mode 100644
index 0000000..a69aae6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Wold-style-definition-2.c
@@ -0,0 +1,10 @@
+/* PR c/12466
+ Test for not warning about ellipsises with -Wold-style-definition. */
+
+/* Origin: Kelley Cook <kcook@gcc.gnu.org> */
+/* { dg-do compile } */
+/* { dg-options "-Wold-style-definition" } */
+
+void bar1 ( ... ) {} /* { dg-error "ISO C requires a named argument" } */
+
+void bar2 (int a, ... ) {}
diff --git a/gcc/testsuite/gcc.dg/wtr-func-def-1.c b/gcc/testsuite/gcc.dg/wtr-func-def-1.c
index c300d22..32d613e 100644
--- a/gcc/testsuite/gcc.dg/wtr-func-def-1.c
+++ b/gcc/testsuite/gcc.dg/wtr-func-def-1.c
@@ -143,21 +143,21 @@ f_impl3(int f)
return 0;
}
-/* Test that we don't warn about stdarg functions. */
+/* Test stdarg functions. */
f_stdarg1(const char *s, ...)
-{
+{ /* { dg-warning "traditional C rejects ISO C style" } */
return 0;
}
void f_stdarg2(const char *s, ...)
-{
+{ /* { dg-warning "traditional C rejects ISO C style" } */
return;
}
extern void f_stdarg3(const char *, ...);
void f_stdarg3(const char *s, ...)
-{
+{ /* { dg-warning "traditional C rejects ISO C style" } */
return;
}