Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2003:
[Freeciv-Dev] Re: (PR#3427) Remove noreturn attribute
Home

[Freeciv-Dev] Re: (PR#3427) Remove noreturn attribute

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients:;
Subject: [Freeciv-Dev] Re: (PR#3427) Remove noreturn attribute
From: "Raimar Falke" <rf13@xxxxxxxxxxxxxxxxx>
Date: Wed, 26 Feb 2003 12:33:43 -0800
Reply-to: rt@xxxxxxxxxxxxxx

On Tue, Feb 18, 2003 at 12:39:22PM -0800, Raimar Falke wrote:
> There is another solution:
> 
> #define die(x)   real_die(x),exit(1)

Attached is the patch. It compiles with gcc3.2 and icc6.0

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
    1) Customers cause problems.
    2) Marketing is trying to create more customers.
  Therefore:
    3) Marketing is evil.

Index: common/shared.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/shared.c,v
retrieving revision 1.99
diff -u -u -r1.99 shared.c
--- common/shared.c     2003/02/16 17:04:14     1.99
+++ common/shared.c     2003/02/26 20:27:54
@@ -651,7 +651,7 @@
   should only be called for code errors - user errors (like not being able
   to find a tileset) should just exit rather than dumping core.
 ***************************************************************************/
-void die(const char *format, ...)
+void real_die(const char *format, ...)
 {
   va_list ap;
 
Index: common/shared.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/shared.h,v
retrieving revision 1.110
diff -u -u -r1.110 shared.h
--- common/shared.h     2002/12/18 19:05:22     1.110
+++ common/shared.h     2003/02/26 20:27:54
@@ -163,8 +163,9 @@
 int cat_snprintf(char *str, size_t n, const char *format, ...)
      fc__attribute((format (printf, 3, 4)));
 
-void die(const char *format, ...)
-     fc__attribute((format (printf, 1, 2))) fc__attribute((noreturn));
+#define die(...) do{real_die(__VA_ARGS__);exit(EXIT_FAILURE);}while(0)
+void real_die(const char *format, ...)
+     fc__attribute((format (printf, 1, 2)));
 
 char *user_home_dir(void);
 char *user_username(void);

[Prev in Thread] Current Thread [Next in Thread]