This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


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

[Ada] Various warning fixes


The following patch has changes removing back-end warnings in the
Ada front end.

  -Geert

2001-10-29  Laurent Guerby  <guerby@acm.org>
	
	* init.c:
	(Raise_From_Signal_Handler, Propagate_Signal_Exception): Make arg
	const.
	(_gnat_error_handler): Make MSG const.

2001-10-29  Richard Kenner <kenner@gnat.com>

	* sysdep.c: Fix localtime_r problem on LynxOS.
	Also remove #elif to avoid warnings.
	
	* misc.c (yyparse): Don't set up and register jmpbuf; remove decls 
	used by this.
	
	* decl.c (annotate_value): Make SIZE unsigned to avoid warning.

*** sysdep.c	2001/09/28 00:17:29	1.3
--- sysdep.c	2001/10/29 15:18:01	1.4
***************
*** 295,304 ****
    || defined (__MACHTEN__)
  #include <termios.h>
  
! #elif defined (VMS)
  extern char *decc$ga_stdscr;
  static int initted = 0;
  #endif
  
  /* Implements the common processing for getc_immediate and
     getc_immediate_nowait. */
--- 295,306 ----
    || defined (__MACHTEN__)
  #include <termios.h>
  
! #else
! #if defined (VMS)
  extern char *decc$ga_stdscr;
  static int initted = 0;
  #endif
+ #endif
  
  /* Implements the common processing for getc_immediate and
     getc_immediate_nowait. */
***************
*** 422,428 ****
      }
  
    else
! #elif defined (VMS)
    int fd = fileno (stream);
  
    if (isatty (fd))
--- 424,431 ----
      }
  
    else
! #else
! #if defined (VMS)
    int fd = fileno (stream);
  
    if (isatty (fd))
***************
*** 444,450 ****
        decc$bsd_nocbreak ();
      }
    else
! #elif defined (__MINGW32__)
    int fd = fileno (stream);
    int char_waiting;
    int eot_ch = 4; /* Ctrl-D */
--- 447,454 ----
        decc$bsd_nocbreak ();
      }
    else
! #else
! #if defined (__MINGW32__)
    int fd = fileno (stream);
    int char_waiting;
    int eot_ch = 4; /* Ctrl-D */
***************
*** 487,492 ****
--- 491,498 ----
      }
    else
  #endif
+ #endif
+ #endif
      {
        /* If we're not on a terminal, then we don't need any fancy processing.
  	 Also this is the only thing that's left if we're not on one of the
***************
*** 571,579 ****
    return tp;
  }
  
! #elif defined (__Lynx__)
  
! /* LynxOS provides a non standard localtime_r */
  
  extern struct tm *__gnat_localtime_r PARAMS ((const time_t *, struct tm *));
  
--- 577,590 ----
    return tp;
  }
  
! #else
! #if defined (__Lynx__) && defined (___THREADS_POSIX4ad4__)
  
! /* As of LynxOS 3.1.0a patch level 040, LynuxWorks changes the
!    prototype to the C library function localtime_r from the POSIX.4
!    Draft 9 to the POSIX 1.c version. Before this change the following
!    spec is required. Only use when ___THREADS_POSIX4ad4__ is defined,
!    the Lynx convention when building against the legacy API. */
  
  extern struct tm *__gnat_localtime_r PARAMS ((const time_t *, struct tm *));
  
***************
*** 582,591 ****
       const time_t *timer;
       struct tm *tp;
  {
!   return localtime_r (tp, timer);
  }
  
! #elif defined (VMS) || defined (__MINGW32__)
  
  /* __gnat_localtime_r is not needed on NT and VMS */
  
--- 593,604 ----
       const time_t *timer;
       struct tm *tp;
  {
!   localtime_r (tp, timer);
!   return NULL;
  }
  
! #else
! #if defined (VMS) || defined (__MINGW32__)
  
  /* __gnat_localtime_r is not needed on NT and VMS */
  
***************
*** 602,605 ****
--- 615,620 ----
  {
    return (struct tm *) localtime_r (timer, tp);
  }
+ #endif
+ #endif
  #endif

*** misc.c	2001/10/23 19:34:50	1.9
--- misc.c	2001/10/29 15:18:00	1.10
***************
*** 154,162 ****
  /* For most front-ends, this is the parser for the language.  For us, we
     process the GNAT tree.  */
  
- #define Set_Jmpbuf_Address system__soft_links__set_jmpbuf_address_soft
- extern void Set_Jmpbuf_Address (void *);
- 
  /* Declare functions we use as part of startup.  */
  extern void __gnat_initialize	PARAMS((void));
  extern void adainit		PARAMS((void));
--- 154,159 ----
***************
*** 165,198 ****
  int
  yyparse ()
  {
-   /* Make up what Gigi uses as a jmpbuf.  */
-   size_t jmpbuf[10];
- 
    /* call the target specific initializations */
    __gnat_initialize();
  
    /* Call the front-end elaboration procedures */
    adainit ();
  
-   /* Set up to catch unhandled exceptions.  */
-   if (__builtin_setjmp (jmpbuf))
-     {
-       Set_Jmpbuf_Address (0);
-       abort ();
-     }
- 
-   /* This is only really needed in longjmp/setjmp mode exceptions
-      but we don't know any easy way to tell what mode the host is
-      compiled in, and it is harmless to do it unconditionally */
- 
-   Set_Jmpbuf_Address (jmpbuf);
- 
    immediate_size_expand = 1;
  
    /* Call the front end */
    _ada_gnat1drv ();
  
-   Set_Jmpbuf_Address (0);
    return 0;
  }
  
--- 162,178 ----

*** init.c	2001/10/29 02:06:21	1.4
--- init.c	2001/10/29 15:17:59	1.5
***************
*** 86,97 ****
  #define Raise_From_Signal_Handler \
                        ada__exceptions__raise_from_signal_handler
  extern void   Raise_From_Signal_Handler PARAMS ((struct Exception_Data *,
! 						char *));
  
  #define Propagate_Signal_Exception \
                        __gnat_propagate_sig_exc
  extern void   Propagate_Signal_Exception
! 	PARAMS ((struct Machine_State *, struct Exception_Data *, char *));
  
  /* Copies of global values computed by the binder */
  int  __gl_main_priority            = -1;
--- 86,97 ----
  #define Raise_From_Signal_Handler \
                        ada__exceptions__raise_from_signal_handler
  extern void   Raise_From_Signal_Handler PARAMS ((struct Exception_Data *,
! 						const char *));
  
  #define Propagate_Signal_Exception \
                        __gnat_propagate_sig_exc
  extern void   Propagate_Signal_Exception
! 	PARAMS ((struct Machine_State *, struct Exception_Data *, const char *));
  
  /* Copies of global values computed by the binder */
  int  __gl_main_priority            = -1;
***************
*** 225,231 ****
       int sig;
  {
    struct Exception_Data *exception;
!   char *msg;
  
    switch (sig)
      {
--- 225,231 ----
       int sig;
  {
    struct Exception_Data *exception;
!   const char *msg;
  
    switch (sig)
      {
***************
*** 555,561 ****
       int sig;
  {
    struct Exception_Data *exception;
!   char *msg;
    static int recurse = 0;
  
    struct sigcontext *info
--- 555,561 ----
       int sig;
  {
    struct Exception_Data *exception;
!   const char *msg;
    static int recurse = 0;
  
    struct sigcontext *info

*** decl.c	2001/10/29 02:01:09	1.9
--- decl.c	2001/10/29 15:17:57	1.10
***************
*** 5247,5253 ****
    TCode tcode;
    Node_Ref_Or_Val ops[3];
    int i;
!   unsigned int size;
  
    /* If we do not return inside this switch, TCODE will be set to the
       code to use for a Create_Node operand and LEN (set above) will be
--- 5247,5253 ----
    TCode tcode;
    Node_Ref_Or_Val ops[3];
    int i;
!   int size;
  
    /* If we do not return inside this switch, TCODE will be set to the
       code to use for a Create_Node operand and LEN (set above) will be


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