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]
Other format: [Raw text]

Eliminate gthr-gnat.[ch] warnings


Howdy,

gthr-gnat.[ch] generate a number of warnings:

 /home/kraai/dev/gcc/build/gcc/xgcc -B/home/kraai/dev/gcc/build/gcc/ -B/home/kraai/dev/gcc/install/powerpc-unknown-linux-gnu/bin/ -B/home/kraai/dev/gcc/install/powerpc-unknown-linux-gnu/lib/ -isystem /home/kraai/dev/gcc/install/powerpc-unknown-linux-gnu/include -isystem /home/kraai/dev/gcc/install/powerpc-unknown-linux-gnu/sys-include -O2  -DIN_GCC    -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -isystem ./include  -fPIC -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED  -I. -I. -I../../gcc/gcc -I../../gcc/gcc/. -I../../gcc/gcc/config -I../../gcc/gcc/../include -fPIC -mstrict-align -fexceptions -c ../../gcc/gcc/gthr-gnat.c -o libgcc/./gthr-gnat.o
 In file included from ../../gcc/gcc/gthr-gnat.c:30:
 ../../gcc/gcc/gthr-gnat.h:37: warning: function declaration isn't a prototype
 ../../gcc/gcc/gthr-gnat.h:37: warning: function declaration isn't a prototype
 ../../gcc/gcc/gthr-gnat.c:40: warning: no previous prototype for `__gnat_default_lock'
 ../../gcc/gcc/gthr-gnat.c:46: warning: no previous prototype for `__gnat_default_unlock'
 ../../gcc/gcc/gthr-gnat.c:50: warning: function declaration isn't a prototype
 ../../gcc/gcc/gthr-gnat.c:51: warning: function declaration isn't a prototype
 ../../gcc/gcc/gthr-gnat.c: In function `__gnat_install_locks':
 ../../gcc/gcc/gthr-gnat.c:55: warning: function declaration isn't a prototype
 ../../gcc/gcc/gthr-gnat.c:56: warning: function declaration isn't a prototype

The following patch eliminates them (as well as two minor
cleanups).  It was bootstrapped and regression tested on
powerpc-unknown-linux-gnu.

OK to commit?

-- 
Matt Kraai <kraai@alumni.cmu.edu>
Debian GNU/Linux Peon

	* gthr-gnat.c: Remove #undef UNUSED.
	(__gnat_default_lock, __gnat_default_unlock): Prototype.
	(__gnat_task_lock, __gnat_task_unlock): Make declarations
	prototypes.
	(__gnat_install_locks): Convert declaration to ISO C90, make
	parameter declarations prototypes, and remove blank line.
	* gthr-gnat.h (__gnat_install_locks): Make parameter
	declarations prototypes.

Index: gcc/gthr-gnat.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gthr-gnat.c,v
retrieving revision 1.1
diff -3 -c -p -r1.1 gthr-gnat.c
*** gcc/gthr-gnat.c	22 Apr 2003 21:52:00 -0000	1.1
--- gcc/gthr-gnat.c	29 May 2003 11:35:02 -0000
*************** Software Foundation, 59 Temple Place - S
*** 35,40 ****
--- 35,43 ----
  #define UNUSED(x) x __attribute__((unused))
  #endif
  
+ void __gnat_default_lock (void);
+ void __gnat_default_unlock (void);
+ 
  void
  __gnat_default_lock (void)
  {
*************** __gnat_default_unlock (void)
*** 47,63 ****
    return;
  }
  
! static void (*__gnat_task_lock) () = *__gnat_default_lock;
! static void (*__gnat_task_unlock) () = *__gnat_default_unlock;
  
   void
! __gnat_install_locks (lock, unlock)
!      void (*lock) ();
!      void (*unlock) ();
  {
    __gnat_task_lock = lock;
    __gnat_task_unlock = unlock;
- 
  }
  
  int
--- 50,63 ----
    return;
  }
  
! static void (*__gnat_task_lock) (void) = *__gnat_default_lock;
! static void (*__gnat_task_unlock) (void) = *__gnat_default_unlock;
  
   void
! __gnat_install_locks (void (*lock) (void), void (*unlock) (void))
  {
    __gnat_task_lock = lock;
    __gnat_task_unlock = unlock;
  }
  
  int
*************** __gthread_mutex_unlock (__gthread_mutex_
*** 79,84 ****
    __gnat_task_unlock ();
    return 0;
  }
- 
- #undef UNUSED
- 
--- 79,81 ----
Index: gcc/gthr-gnat.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gthr-gnat.h,v
retrieving revision 1.1
diff -3 -c -p -r1.1 gthr-gnat.h
*** gcc/gthr-gnat.h	22 Apr 2003 21:52:00 -0000	1.1
--- gcc/gthr-gnat.h	29 May 2003 11:35:02 -0000
*************** typedef int __gthread_mutex_t;
*** 34,40 ****
  
  #define __GTHREAD_MUTEX_INIT 0
  
! extern void __gnat_install_locks (void (*lock) (), void (*unlock) ());
  extern int __gthread_active_p (void);
  extern int __gthread_mutex_lock (__gthread_mutex_t *);
  extern int __gthread_mutex_unlock (__gthread_mutex_t *);
--- 34,40 ----
  
  #define __GTHREAD_MUTEX_INIT 0
  
! extern void __gnat_install_locks (void (*lock) (void), void (*unlock) (void));
  extern int __gthread_active_p (void);
  extern int __gthread_mutex_lock (__gthread_mutex_t *);
  extern int __gthread_mutex_unlock (__gthread_mutex_t *);


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