This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java 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]

Re: [PATCH PING]: Add some java format attributes


 > On Wed, Jun 08, 2005 at 06:29:22PM -0400, Kaveh R. Ghazi wrote:
 > > Would a java maintainer please review this patch?
 > > 
 > > http://gcc.gnu.org/ml/java-patches/2005-q2/msg00582.html
 > 
 > The patch certainly doesn't apply anymore.
 >     Jakub

Hmm, yeah.  After your java patch from Jun 6, my patch needs to
replace "msgid" with "gmsgid".

Patch to that effect bootstrapped on x86_64-unknown-linux-gnu, no
regressions.  Okay for mainline?

		--Kaveh


2005-06-08  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.
	
diff -rup orig/egcc-CVS20050607/gcc/java/gjavah.c egcc-CVS20050607/gcc/java/gjavah.c
--- orig/egcc-CVS20050607/gcc/java/gjavah.c	2005-06-06 19:12:46.000000000 -0400
+++ egcc-CVS20050607/gcc/java/gjavah.c	2005-06-08 18:36:09.000000000 -0400
@@ -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 -rup orig/egcc-CVS20050607/gcc/java/java-tree.h egcc-CVS20050607/gcc/java/java-tree.h
--- orig/egcc-CVS20050607/gcc/java/java-tree.h	2005-06-06 19:12:46.000000000 -0400
+++ egcc-CVS20050607/gcc/java/java-tree.h	2005-06-08 18:36:48.000000000 -0400
@@ -1305,7 +1305,6 @@ extern tree emit_symbol_table (tree, tre
 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 -rup orig/egcc-CVS20050607/gcc/java/parse.h egcc-CVS20050607/gcc/java/parse.h
--- orig/egcc-CVS20050607/gcc/java/parse.h	2005-05-10 21:25:37.000000000 -0400
+++ egcc-CVS20050607/gcc/java/parse.h	2005-06-08 18:37:19.000000000 -0400
@@ -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 -rup orig/egcc-CVS20050607/gcc/java/parse.y egcc-CVS20050607/gcc/java/parse.y
--- orig/egcc-CVS20050607/gcc/java/parse.y	2005-06-06 19:12:47.000000000 -0400
+++ egcc-CVS20050607/gcc/java/parse.y	2005-06-08 18:37:41.000000000 -0400
@@ -96,7 +96,7 @@ static tree lookup_java_method2 (tree, t
 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 -rup orig/egcc-CVS20050607/gcc/java/verify-impl.c egcc-CVS20050607/gcc/java/verify-impl.c
--- orig/egcc-CVS20050607/gcc/java/verify-impl.c	2005-03-07 19:11:21.000000000 -0500
+++ egcc-CVS20050607/gcc/java/verify-impl.c	2005-06-08 18:35:32.000000000 -0400
@@ -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


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