rsync v2.6.9: small patch fixing NORETURN failures

ThMO thmo-13 at gmx.de
Tue Nov 21 20:45:01 GMT 2006


Hello,

as of gcc v2.7.2.1, the noreturn attribute needs to be given
*after* the prototype declaration and not before, but for
gcc v3.x, things changed for this attribute again, since
gcc v2.5.x did it the way, newer gcc versions prefer it...

I've applied a small unified diff, fixing this stuff.

THX for listening.

CU Tom.
(Thomas M.Ott)
Germany
-------------- next part --------------
--- rsync-2.6.9/proto.h.orig	2006-11-07 05:39:47.000000000 +0100
+++ rsync-2.6.9/proto.h	2006-11-21 21:32:26.000000000 +0100
@@ -21,7 +21,7 @@
 int tweak_mode(int mode, struct chmod_mode_struct *chmod_modes);
 int free_chmod_mode(struct chmod_mode_struct *chmod_modes);
 void close_all(void);
-NORETURN void _exit_cleanup(int code, const char *file, int line);
+NORETURN void _exit_cleanup(int code, const char *file, int line) NORETURN2;
 void cleanup_disable(void);
 void cleanup_set(char *fnametmp, char *fname, struct file_struct *file,
 		 int fd_r, int fd_w);
@@ -276,8 +276,8 @@
 void set_blocking(int fd);
 int fd_pair(int fd[2]);
 void print_child_argv(char **cmd);
-NORETURN void out_of_memory(char *str);
-NORETURN void overflow_exit(char *str);
+NORETURN void out_of_memory(char *str) NORETURN2;
+NORETURN void overflow_exit(char *str) NORETURN2;
 int set_modtime(char *fname, time_t modtime, mode_t mode);
 int mkdir_defmode(char *fname);
 int create_directory_path(char *fname);
--- rsync-2.6.9/rsync.h.orig	2006-10-24 05:31:30.000000000 +0200
+++ rsync-2.6.9/rsync.h	2006-11-21 21:32:09.000000000 +0100
@@ -667,7 +667,16 @@
 #endif
 
 #define UNUSED(x) x __attribute__((__unused__))
+#if	__GNUC__ > 2
 #define NORETURN __attribute__((__noreturn__))
+#define	NORETURN2 /**/
+#elif	__GNUC__ == 2		/* (ThMO) */
+#define	NORETURN /**/
+#define NORETURN2 __attribute__((__noreturn__))
+#else
+#define	NORETURN /**/
+#define	NORETURN2 /**/
+#endif
 
 #include "proto.h"
 


More information about the rsync mailing list