aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@gcc.gnu.org>1999-02-22 20:44:23 -0500
committerJason Merrill <jason@gcc.gnu.org>1999-02-22 20:44:23 -0500
commit8be64d09528ddca088f48547cb1794c5b089aaa7 (patch)
tree57ea4d0cdc8e43aee2aa4be34ed4a75b54dd34d8
parentbd022652bf81864eec39c749155a229116913163 (diff)
downloadgcc-8be64d09528ddca088f48547cb1794c5b089aaa7.zip
gcc-8be64d09528ddca088f48547cb1794c5b089aaa7.tar.gz
gcc-8be64d09528ddca088f48547cb1794c5b089aaa7.tar.bz2
errfn.c: Change varargs code to look like toplev.c.
* errfn.c: Change varargs code to look like toplev.c. * method.c (process_modifiers): Don't prepend 'U' for char or wchar_t. From-SVN: r25386
-rw-r--r--gcc/cp/ChangeLog9
-rw-r--r--gcc/cp/errfn.c130
-rw-r--r--gcc/cp/method.c16
3 files changed, 117 insertions, 38 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index a4d9d60..8aacd3f 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,10 +1,17 @@
-Sun Feb 21 20:38:00 1999 H.J. Lu (hjl@gnu.org)
+1999-02-23 Jason Merrill <jason@yorick.cygnus.com>
+
+ * errfn.c: Change varargs code to look like toplev.c.
+
+ * method.c (process_modifiers): Don't prepend 'U' for char or
+ wchar_t.
+
1999-02-20 Craig Burley <craig@jcb-sc.com>
* Make-lang.in (cplib2.ready): Don't consider updating
cplib2 stuff if the current directory isn't writable, as
it won't work (such as during a `make install').
+Sun Feb 21 20:38:00 1999 H.J. Lu (hjl@gnu.org)
* decl2.c (start_objects): Make file scope constructors and
destructors local to the file if ASM_OUTPUT_CONSTRUCTOR and
diff --git a/gcc/cp/errfn.c b/gcc/cp/errfn.c
index 46a5f66..fd8a6d4 100644
--- a/gcc/cp/errfn.c
+++ b/gcc/cp/errfn.c
@@ -1,5 +1,5 @@
/* Provide a call-back mechanism for handling error output.
- Copyright (C) 1993, 94-97, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1993, 94-98, 1999 Free Software Foundation, Inc.
Contributed by Jason Merrill (jason@cygnus.com)
This file is part of GNU CC.
@@ -47,17 +47,12 @@ extern int cp_line_of PROTO((tree));
/* This function supports only `%s', `%d', `%%', and the C++ print
codes. */
-#ifdef __STDC__
-static void
-cp_thing (errorfn *errfn, int atarg1, const char *format, va_list ap)
-#else
static void
cp_thing (errfn, atarg1, format, ap)
errorfn *errfn;
int atarg1;
const char *format;
va_list ap;
-#endif
{
static char *buf;
static long buflen;
@@ -194,81 +189,154 @@ cp_thing (errfn, atarg1, format, ap)
}
-#ifdef __STDC__
-#define DECLARE(name) void name (const char *format, ...)
-#define INIT va_start (ap, format)
-#else
-#define DECLARE(name) void name (format, va_alist) char *format; va_dcl
-#define INIT va_start (ap)
-#endif
-
-DECLARE (cp_error)
+void
+cp_error VPROTO((const char *format, ...))
{
+#ifndef ANSI_PROTOTYPES
+ char *format;
+#endif
va_list ap;
- INIT;
+
+ VA_START (ap, format);
+
+#ifndef ANSI_PROTOTYPES
+ format = va_arg (ap, char *);
+#endif
+
if (! cp_silent)
cp_thing ((errorfn *) error, 0, format, ap);
va_end (ap);
}
-DECLARE (cp_warning)
+void
+cp_warning VPROTO((const char *format, ...))
{
+#ifndef ANSI_PROTOTYPES
+ char *format;
+#endif
va_list ap;
- INIT;
+
+ VA_START (ap, format);
+
+#ifndef ANSI_PROTOTYPES
+ format = va_arg (ap, char *);
+#endif
+
if (! cp_silent)
cp_thing ((errorfn *) warning, 0, format, ap);
va_end (ap);
}
-DECLARE (cp_pedwarn)
+void
+cp_pedwarn VPROTO((const char *format, ...))
{
+#ifndef ANSI_PROTOTYPES
+ char *format;
+#endif
va_list ap;
- INIT;
+
+ VA_START (ap, format);
+
+#ifndef ANSI_PROTOTYPES
+ format = va_arg (ap, char *);
+#endif
+
if (! cp_silent)
cp_thing ((errorfn *) pedwarn, 0, format, ap);
va_end (ap);
}
-DECLARE (cp_compiler_error)
+extern errorfn compiler_error;
+
+void
+cp_compiler_error VPROTO((const char *format, ...))
{
- extern errorfn compiler_error;
+#ifndef ANSI_PROTOTYPES
+ char *format;
+#endif
va_list ap;
- INIT;
+
+ VA_START (ap, format);
+
+#ifndef ANSI_PROTOTYPES
+ format = va_arg (ap, char *);
+#endif
+
if (! cp_silent)
cp_thing (compiler_error, 0, format, ap);
va_end (ap);
}
-DECLARE (cp_sprintf)
+void
+cp_sprintf VPROTO((const char *format, ...))
{
+#ifndef ANSI_PROTOTYPES
+ char *format;
+#endif
va_list ap;
- INIT;
+
+ VA_START (ap, format);
+
+#ifndef ANSI_PROTOTYPES
+ format = va_arg (ap, char *);
+#endif
+
cp_thing ((errorfn *) sprintf, 0, format, ap);
va_end (ap);
}
-DECLARE (cp_error_at)
+void
+cp_error_at VPROTO((const char *format, ...))
{
+#ifndef ANSI_PROTOTYPES
+ char *format;
+#endif
va_list ap;
- INIT;
+
+ VA_START (ap, format);
+
+#ifndef ANSI_PROTOTYPES
+ format = va_arg (ap, char *);
+#endif
+
if (! cp_silent)
cp_thing ((errorfn *) error_with_file_and_line, 1, format, ap);
va_end (ap);
}
-DECLARE (cp_warning_at)
+void
+cp_warning_at VPROTO((const char *format, ...))
{
+#ifndef ANSI_PROTOTYPES
+ char *format;
+#endif
va_list ap;
- INIT;
+
+ VA_START (ap, format);
+
+#ifndef ANSI_PROTOTYPES
+ format = va_arg (ap, char *);
+#endif
+
if (! cp_silent)
cp_thing ((errorfn *) warning_with_file_and_line, 1, format, ap);
va_end (ap);
}
-DECLARE (cp_pedwarn_at)
+void
+cp_pedwarn_at VPROTO((const char *format, ...))
{
+#ifndef ANSI_PROTOTYPES
+ char *format;
+#endif
va_list ap;
- INIT;
+
+ VA_START (ap, format);
+
+#ifndef ANSI_PROTOTYPES
+ format = va_arg (ap, char *);
+#endif
+
if (! cp_silent)
cp_thing ((errorfn *) pedwarn_with_file_and_line, 1, format, ap);
va_end (ap);
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index abd3708..f3530dd 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -1,6 +1,6 @@
/* Handle the hair of processing (but not expanding) inline functions.
Also manage function and variable name overloading.
- Copyright (C) 1987, 89, 92-97, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1987, 89, 92-97, 1998, 1999 Free Software Foundation, Inc.
Contributed by Michael Tiemann (tiemann@cygnus.com)
This file is part of GNU CC.
@@ -1201,7 +1201,8 @@ build_mangled_name (parmtypes, begin, end)
return (char *)obstack_base (&scratch_obstack);
}
-/* handles emitting modifiers such as Constant, read-only, and volatile */
+/* Emit modifiers such as constant, read-only, and volatile. */
+
void
process_modifiers (parmtype)
tree parmtype;
@@ -1212,6 +1213,8 @@ process_modifiers (parmtype)
if (TYPE_READONLY (parmtype))
OB_PUTC ('C');
if (TREE_CODE (parmtype) == INTEGER_TYPE
+ && parmtype != char_type_node
+ && parmtype != wchar_type_node
&& (TYPE_MAIN_VARIANT (parmtype)
== unsigned_type (TYPE_MAIN_VARIANT (parmtype)))
&& ! TYPE_FOR_JAVA (parmtype))
@@ -1267,7 +1270,8 @@ check_btype (type)
return 0;
}
-/* handle emitting the correct code for various node types */
+/* Emit the correct code for various node types. */
+
static void
process_overload_item (parmtype, extra_Gcode)
tree parmtype;
@@ -1275,9 +1279,9 @@ process_overload_item (parmtype, extra_Gcode)
{
numeric_output_need_bar = 0;
- /* These tree types are considered modifiers for B code squangling , */
- /* and therefore should not get entries in the Btypelist */
- /* they are, however, repeatable types */
+ /* These tree types are considered modifiers for B code squangling,
+ and therefore should not get entries in the Btypelist. They are,
+ however, repeatable types. */
switch (TREE_CODE (parmtype))
{