Patchwork [Ada] Further tweak for PR ada/52123

login
register
mail settings
Submitter Eric Botcazou
Date March 8, 2013, 8:02 a.m.
Message ID <18931433.WWmR0f37Ab@polaris>
Download mbox | patch
Permalink /patch/226033/
State New
Headers show

Comments

Eric Botcazou - March 8, 2013, 8:02 a.m.
Tested by Cesar on i686-pc-mingw32, applied on mainline and 4.7 branch.


2013-03-08  Cesar Strauss  <cestrauss@gmail.com>

	PR ada/52123
	* seh_init.c (Raise_From_Signal_Handler): Declare as no-return.
	(__gnat_SEH_error_handler): Likewise.  Remove final return.

Patch

Index: seh_init.c
===================================================================
--- seh_init.c	(revision 196487)
+++ seh_init.c	(working copy)
@@ -6,7 +6,7 @@ 
  *                                                                          *
  *                          C Implementation File                           *
  *                                                                          *
- *           Copyright (C) 2005-2012, Free Software Foundation, Inc.        *
+ *           Copyright (C) 2005-2013, Free Software Foundation, Inc.        *
  *                                                                          *
  * GNAT is free software;  you can  redistribute it  and/or modify it under *
  * terms of the  GNU General Public License as published  by the Free Soft- *
@@ -60,7 +60,8 @@  extern struct Exception_Data _abort_sign
 
 #define Raise_From_Signal_Handler \
                       ada__exceptions__raise_from_signal_handler
-extern void Raise_From_Signal_Handler (struct Exception_Data *, const char *);
+extern void Raise_From_Signal_Handler (struct Exception_Data *, const char *)
+  ATTRIBUTE_NORETURN;
 
 
 #if defined (_WIN32)
@@ -72,7 +73,7 @@  extern void Raise_From_Signal_Handler (s
 extern void _global_unwind2 (void *);
 
 EXCEPTION_DISPOSITION __gnat_SEH_error_handler
-(struct _EXCEPTION_RECORD*, void*, struct _CONTEXT*, void*);
+(struct _EXCEPTION_RECORD*, void*, struct _CONTEXT*, void*) ATTRIBUTE_NORETURN;
 
 struct Exception_Data *
 __gnat_map_SEH (EXCEPTION_RECORD* ExceptionRecord, const char **msg);
@@ -198,7 +199,6 @@  __gnat_SEH_error_handler (struct _EXCEPT
 #endif
 
   Raise_From_Signal_Handler (exception, msg);
-  return 0; /* This is never reached, avoid compiler warning  */
 }
 #endif /* !(defined (_WIN64) && defined (__SEH__)) */