[kaffe] CVS kaffe (dalibor): First pass at adding __attribute__ everywhere

Kaffe CVS Kaffe Mailing List <kaffe@kaffe.org>
Mon Mar 29 12:28:02 2004


PatchSet 4590 
Date: 2004/03/29 20:24:26
Author: dalibor
Branch: HEAD
Tag: (none) 
Log:
First pass at adding __attribute__ everywhere

Members: 
	ChangeLog:1.2168->1.2169 
	config/config-std.h:1.10->1.11 
	include/errors.h:1.10->1.11 
	include/jni.h:1.27->1.28 
	include/native.h:1.13->1.14 
	kaffe/kaffeh/mem.c:1.3->1.4 
	kaffe/kaffevm/exception.c:1.78->1.79 
	kaffe/kaffevm/exception.h:1.23->1.24 
	kaffe/kaffevm/support.h:1.28->1.29 
	kaffe/kaffevm/mem/gc-incremental.c:1.74->1.75 
	kaffe/kaffevm/systems/beos-native/jthread.h:1.4->1.5 
	kaffe/kaffevm/systems/oskit-pthreads/jthread.h:1.10->1.11 
	kaffe/kaffevm/systems/unix-jthreads/jthread.h:1.51->1.52 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.2168 kaffe/ChangeLog:1.2169
--- kaffe/ChangeLog:1.2168	Mon Mar 29 19:45:24 2004
+++ kaffe/ChangeLog	Mon Mar 29 20:24:26 2004
@@ -1,7 +1,11 @@
 2004-03-29  Adam Heath <doogie@debian.org>
 
+	First pass at adding __attribute__ to various places.
+
+2004-03-29  Adam Heath <doogie@debian.org>
+
 	* configure.ac:
-	Enabled checking of __attribute__ inc onfigure.
+	Enabled checking of __attribute__ in configure.
 
 	* m4/gcc_attribute.m4: New file.
 
Index: kaffe/config/config-std.h
diff -u kaffe/config/config-std.h:1.10 kaffe/config/config-std.h:1.11
--- kaffe/config/config-std.h:1.10	Wed Mar 24 20:38:43 2004
+++ kaffe/config/config-std.h	Mon Mar 29 20:24:29 2004
@@ -52,13 +52,6 @@
 #include <kernel/OS.h>
 #endif
 
-#undef	__NORETURN__
-#if defined(__GNUC__)
-#define	__NORETURN__ __attribute__((__noreturn__))
-#else
-#define	__NORETURN__
-#endif
-
 #undef	__UNUSED__
 #if defined(__GNUC__)
 #define	__UNUSED__ __attribute__((__unused__))
Index: kaffe/include/errors.h
diff -u kaffe/include/errors.h:1.10 kaffe/include/errors.h:1.11
--- kaffe/include/errors.h:1.10	Sat Feb 28 18:44:27 2004
+++ kaffe/include/errors.h	Mon Mar 29 20:24:29 2004
@@ -12,6 +12,7 @@
 #ifndef __errors_h
 #define __errors_h
 
+#include "config.h"
 #include "config-std.h"
 #include <stdarg.h>
 
@@ -42,11 +43,11 @@
 
 /* post an exception with a print like message */
 extern void postExceptionMessage(errorInfo *, 
-	const char *name, const char *msgfmt, ...);
+	const char *name, const char *msgfmt, ...) PRINTFFORMAT(3,4);
 
 /* va_list version of postExceptionMessage */
 extern void vpostExceptionMessage(errorInfo *einfo,
-        const char * fullname, const char * fmt, va_list args);
+        const char * fullname, const char * fmt, va_list args) PRINTFFORMAT(3,0);
 
 /* post an out of memory condition */
 extern void postOutOfMemory(errorInfo *einfo);
@@ -108,7 +109,7 @@
 
 #if !defined(KAFFEH)
 
-void throwError(struct _errorInfo*) __NORETURN__;
+void throwError(struct _errorInfo*) NONRETURNING;
 
 /*
  * KMALLOC and all the allocating string functions return null on
Index: kaffe/include/jni.h
diff -u kaffe/include/jni.h:1.27 kaffe/include/jni.h:1.28
--- kaffe/include/jni.h:1.27	Fri Mar 12 16:56:58 2004
+++ kaffe/include/jni.h	Mon Mar 29 20:24:29 2004
@@ -18,17 +18,14 @@
 #include "kaffe/jtypes.h"
 #include "kaffe/jmalloc.h"
 
-#undef  __NORETURN__
-#if defined(__GNUC__)
-#define __NORETURN__ __attribute__((noreturn))
-#else
-#define __NORETURN__
-#endif
-
 #if defined(__cplusplus)
 extern "C" {
 #endif
 
+#ifndef NONRETURNING
+#define NONRETURNING
+#endif
+
 #define	JNIEXPORT extern
 #define	JNICALL
 
@@ -59,8 +56,8 @@
 	const char*	classpath;
 	const char*     bootClasspath;
 	jint		(*vfprintf)(FILE*, const char*, va_list);
-	void		(*exit)(jint) __NORETURN__;
-	void		(*abort)(void) __NORETURN__;
+	void		(*exit)(jint) NONRETURNING;
+	void		(*abort)(void) NONRETURNING;
 	jint		enableClassGC;
 	jint		enableVerboseGC;
 	jint		disableAsyncGC;
Index: kaffe/include/native.h
diff -u kaffe/include/native.h:1.13 kaffe/include/native.h:1.14
--- kaffe/include/native.h:1.13	Sat Mar 27 16:07:31 2004
+++ kaffe/include/native.h	Mon Mar 29 20:24:29 2004
@@ -12,13 +12,6 @@
 #ifndef __native_h
 #define __native_h
 
-#undef	__NORETURN__
-#if defined(__GNUC__)
-#define	__NORETURN__	__attribute__((noreturn))
-#else
-#define	__NORETURN__
-#endif
-
 #include <kaffe/jtypes.h>
 
 struct _methods;
Index: kaffe/kaffe/kaffeh/mem.c
diff -u kaffe/kaffe/kaffeh/mem.c:1.3 kaffe/kaffe/kaffeh/mem.c:1.4
--- kaffe/kaffe/kaffeh/mem.c:1.3	Mon Mar  8 21:21:06 2004
+++ kaffe/kaffe/kaffeh/mem.c	Mon Mar 29 20:24:29 2004
@@ -28,6 +28,7 @@
 static void* gcRealloc(struct _Collector*, void*, size_t, gc_alloc_type_t);
 static void  gcFree(struct _Collector*, void*);
 
+extern void postExceptionMessage(struct _errorInfo *e, const char *name, const char *msgfmt, ...) PRINTFFORMAT(3,4);
 /*
  * We use a very simple 'fake' garbage collector interface
  */
Index: kaffe/kaffe/kaffevm/exception.c
diff -u kaffe/kaffe/kaffevm/exception.c:1.78 kaffe/kaffe/kaffevm/exception.c:1.79
--- kaffe/kaffe/kaffevm/exception.c:1.78	Mon Mar  8 21:21:08 2004
+++ kaffe/kaffe/kaffevm/exception.c	Mon Mar 29 20:24:30 2004
@@ -68,7 +68,7 @@
 
 static void nullException(struct _exceptionFrame *);
 static void floatingException(struct _exceptionFrame *);
-static void dispatchException(Hjava_lang_Throwable*, stackTraceInfo*) __NORETURN__;
+static void dispatchException(Hjava_lang_Throwable*, stackTraceInfo*) NONRETURNING;
 
 extern void printStackTrace(struct Hjava_lang_Throwable*, struct Hjava_lang_Object*, int);
 
Index: kaffe/kaffe/kaffevm/exception.h
diff -u kaffe/kaffe/kaffevm/exception.h:1.23 kaffe/kaffe/kaffevm/exception.h:1.24
--- kaffe/kaffe/kaffevm/exception.h:1.23	Sun Sep 28 22:30:19 2003
+++ kaffe/kaffe/kaffevm/exception.h	Mon Mar 29 20:24:30 2004
@@ -96,11 +96,11 @@
 
 #define VMEXCEPTHANDLER_KAFFEJNI_HANDLER ((struct _methods*)1)
 
-void throwException(struct Hjava_lang_Throwable*) __NORETURN__;
-void throwExternalException(struct Hjava_lang_Throwable*) __NORETURN__;
+void throwException(struct Hjava_lang_Throwable*) NONRETURNING; 
+void throwExternalException(struct Hjava_lang_Throwable*) NONRETURNING;
 struct Hjava_lang_Throwable* error2Throwable(struct _errorInfo* einfo);
 
-void unhandledException(struct Hjava_lang_Throwable *eobj) __NORETURN__;
+void unhandledException(struct Hjava_lang_Throwable *eobj) NONRETURNING;
 
 extern void initExceptions(void);
 
@@ -113,7 +113,7 @@
 static inline struct Hjava_lang_Object* vmExcept_getSyncObj(VmExceptHandler* eh) __UNUSED__;
 static inline void vmExcept_setPC(volatile VmExceptHandler* eh, u4 pc) __UNUSED__;
 static inline u4 vmExcept_getPC(const VmExceptHandler* eh) __UNUSED__;
-static inline void vmExcept_jumpToHandler(VmExceptHandler* frame) __UNUSED__ __NORETURN__;
+static inline void vmExcept_jumpToHandler(VmExceptHandler* frame) __UNUSED__ NONRETURNING;
 
 static inline bool
 vmExcept_isJNIFrame(VmExceptHandler* eh)
Index: kaffe/kaffe/kaffevm/support.h
diff -u kaffe/kaffe/kaffevm/support.h:1.28 kaffe/kaffe/kaffevm/support.h:1.29
--- kaffe/kaffe/kaffevm/support.h:1.28	Sat Mar 27 16:07:32 2004
+++ kaffe/kaffe/kaffevm/support.h	Mon Mar 29 20:24:30 2004
@@ -127,10 +127,10 @@
 extern struct _methods*	lookupObjectMethod(struct Hjava_lang_Object*, const char*, const char*, struct _errorInfo*);
 
 struct _strconst;
-extern void SignalError(const char *, const char *) __NORETURN__;
-extern void SignalErrorf(const char *, const char *, ...) __NORETURN__;
-extern void unimp(const char*) __NORETURN__;
-extern void kprintf(FILE*, const char*, ...);
+extern void SignalError(const char *, const char *) NONRETURNING;
+extern void SignalErrorf(const char *, const char *, ...) NONRETURNING PRINTFFORMAT(2,3);
+extern void unimp(const char*) NONRETURNING;
+extern void kprintf(FILE*, const char*, ...) PRINTFFORMAT(2,3);
 extern int addClasspath(const char*);
 extern int prependClasspath(const char*);
 
Index: kaffe/kaffe/kaffevm/mem/gc-incremental.c
diff -u kaffe/kaffe/kaffevm/mem/gc-incremental.c:1.74 kaffe/kaffe/kaffevm/mem/gc-incremental.c:1.75
--- kaffe/kaffe/kaffevm/mem/gc-incremental.c:1.74	Wed Mar 24 20:23:57 2004
+++ kaffe/kaffe/kaffevm/mem/gc-incremental.c	Mon Mar 29 20:24:30 2004
@@ -1001,7 +1001,7 @@
  * collector.
  */
 
-void throwOutOfMemory(void) __NORETURN__;
+void throwOutOfMemory(void) NONRETURNING;
 
 static
 void*
Index: kaffe/kaffe/kaffevm/systems/beos-native/jthread.h
diff -u kaffe/kaffe/kaffevm/systems/beos-native/jthread.h:1.4 kaffe/kaffe/kaffevm/systems/beos-native/jthread.h:1.5
--- kaffe/kaffe/kaffevm/systems/beos-native/jthread.h:1.4	Sat Jul  8 20:58:09 2000
+++ kaffe/kaffe/kaffevm/systems/beos-native/jthread.h	Mon Mar 29 20:24:31 2004
@@ -222,7 +222,7 @@
 /*
  * have the current thread exit
  */
-void 	jthread_exit(void) __NORETURN__;
+void 	jthread_exit(void) NONRETURNING;
 
 /*
  * determine whether a location is on the stack of the current thread
Index: kaffe/kaffe/kaffevm/systems/oskit-pthreads/jthread.h
diff -u kaffe/kaffe/kaffevm/systems/oskit-pthreads/jthread.h:1.10 kaffe/kaffe/kaffevm/systems/oskit-pthreads/jthread.h:1.11
--- kaffe/kaffe/kaffevm/systems/oskit-pthreads/jthread.h:1.10	Mon May 26 21:38:47 2003
+++ kaffe/kaffe/kaffevm/systems/oskit-pthreads/jthread.h	Mon Mar 29 20:24:31 2004
@@ -206,7 +206,7 @@
 /*
  * have the current thread exit
  */
-void 	jthread_exit(void) __NORETURN__;
+void 	jthread_exit(void) NONRETURNING;
 
 /*
  * determine whether a location is on the stack of the current thread
Index: kaffe/kaffe/kaffevm/systems/unix-jthreads/jthread.h
diff -u kaffe/kaffe/kaffevm/systems/unix-jthreads/jthread.h:1.51 kaffe/kaffe/kaffevm/systems/unix-jthreads/jthread.h:1.52
--- kaffe/kaffe/kaffevm/systems/unix-jthreads/jthread.h:1.51	Sun Feb  1 22:14:54 2004
+++ kaffe/kaffe/kaffevm/systems/unix-jthreads/jthread.h	Mon Mar 29 20:24:31 2004
@@ -232,7 +232,7 @@
 /*
  * have the current thread exit
  */
-void 	jthread_exit(void) __NORETURN__;
+void 	jthread_exit(void) NONRETURNING;
 
 /*
  * determine whether a location is on the stack of the current thread