summaryrefslogtreecommitdiff
path: root/gcc/java
diff options
context:
space:
mode:
authorghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-09 10:55:02 +0000
committerghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-09 10:55:02 +0000
commit72492c1fe0de149d745326fbf52b5a1cb4e56951 (patch)
treed804d043f0b74c4f477e203f8a196d464273e235 /gcc/java
parent50c96bdc94966c6f16d1bf39168ca78adfc8216b (diff)
downloadgcc-72492c1fe0de149d745326fbf52b5a1cb4e56951.tar.gz
* gjavah.c (error): Add ATTRIBUTE_PRINTF_1.
* java-tree.h (parse_error_context): Move... * parse.h (parse_error_context): ... here, add ATTRIBUTE_GCC_DIAG. * parse.y (parse_warning_context): Add ATTRIBUTE_GCC_DIAG. * verify-impl.c (debug_print): Add ATTRIBUTE_PRINTF_1. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100795 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java')
-rw-r--r--gcc/java/ChangeLog8
-rw-r--r--gcc/java/gjavah.c2
-rw-r--r--gcc/java/java-tree.h1
-rw-r--r--gcc/java/parse.h4
-rw-r--r--gcc/java/parse.y2
-rw-r--r--gcc/java/verify-impl.c13
6 files changed, 18 insertions, 12 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index b6b4a516e46..eeb8af49355 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,11 @@
+2005-06-09 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * gjavah.c (error): Add ATTRIBUTE_PRINTF_1.
+ * java-tree.h (parse_error_context): Move...
+ * parse.h (parse_error_context): ... here, add ATTRIBUTE_GCC_DIAG.
+ * parse.y (parse_warning_context): Add ATTRIBUTE_GCC_DIAG.
+ * verify-impl.c (debug_print): Add ATTRIBUTE_PRINTF_1.
+
2005-06-08 Roger Sayle <roger@eyesopen.com>
* typeck.c (convert): Only clear TREE_OVERFLOW on INTEGER_CST nodes.
diff --git a/gcc/java/gjavah.c b/gcc/java/gjavah.c
index 5b36dae34bc..acf62afdbec 100644
--- a/gcc/java/gjavah.c
+++ b/gcc/java/gjavah.c
@@ -164,7 +164,7 @@ static const unsigned char *
decode_signature_piece (FILE *, const unsigned char *,
const unsigned char *, int *);
static void print_class_decls (FILE *, JCF *, int);
-static void error (const char *gmsgid, ...);
+static void error (const char *gmsgid, ...) ATTRIBUTE_PRINTF_1;
static void usage (void) ATTRIBUTE_NORETURN;
static void help (void) ATTRIBUTE_NORETURN;
static void version (void) ATTRIBUTE_NORETURN;
diff --git a/gcc/java/java-tree.h b/gcc/java/java-tree.h
index 53e9cfd1a47..826d4cba19e 100644
--- a/gcc/java/java-tree.h
+++ b/gcc/java/java-tree.h
@@ -1305,7 +1305,6 @@ extern tree emit_symbol_table (tree, tree, tree, tree, tree, int);
extern void lang_init_source (int);
extern void write_classfile (tree);
extern char *print_int_node (tree);
-extern void parse_error_context (tree cl, const char *gmsgid, ...);
extern void finish_class (void);
extern void java_layout_seen_class_methods (void);
extern void check_for_initialization (tree, tree);
diff --git a/gcc/java/parse.h b/gcc/java/parse.h
index 232eead9862..c016fad1b5d 100644
--- a/gcc/java/parse.h
+++ b/gcc/java/parse.h
@@ -120,6 +120,10 @@ extern tree stabilize_reference (tree);
}
#endif
+#ifdef ATTRIBUTE_GCC_DIAG
+extern void parse_error_context (tree cl, const char *gmsgid, ...) ATTRIBUTE_GCC_DIAG(2,3);
+#endif
+
#define ABSTRACT_CHECK(FLAG, V, CL, S) \
if ((FLAG) & (V)) \
parse_error_context ((CL), "%s method can't be abstract", (S));
diff --git a/gcc/java/parse.y b/gcc/java/parse.y
index 632b7ec43fc..ebaede8ab12 100644
--- a/gcc/java/parse.y
+++ b/gcc/java/parse.y
@@ -96,7 +96,7 @@ static tree lookup_java_method2 (tree, tree, int);
static tree method_header (int, tree, tree, tree);
static void fix_method_argument_names (tree ,tree);
static tree method_declarator (tree, tree);
-static void parse_warning_context (tree cl, const char *gmsgid, ...);
+static void parse_warning_context (tree cl, const char *gmsgid, ...) ATTRIBUTE_GCC_DIAG(2,3);
#ifdef USE_MAPPED_LOCATION
static void issue_warning_error_from_context
(source_location, const char *gmsgid, va_list *);
diff --git a/gcc/java/verify-impl.c b/gcc/java/verify-impl.c
index 30d12209449..db6078e9c97 100644
--- a/gcc/java/verify-impl.c
+++ b/gcc/java/verify-impl.c
@@ -26,21 +26,16 @@ details. */
verification. */
#define INVALID_STATE ((state *) -1)
-#ifdef VERIFY_DEBUG
-static void
-debug_print (const char *fmt, ...)
+static void ATTRIBUTE_PRINTF_1
+debug_print (const char *fmt ATTRIBUTE_UNUSED, ...)
{
+#ifdef VERIFY_DEBUG
va_list ap;
va_start (ap, fmt);
vfprintf (stderr, fmt, ap);
va_end (ap);
-}
-#else
-static void
-debug_print (const char *fmt ATTRIBUTE_UNUSED, ...)
-{
-}
#endif /* VERIFY_DEBUG */
+}
/* This started as a fairly ordinary verifier, and for the most part
it remains so. It works in the obvious way, by modeling the effect