This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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]

PATCH [libiberty]: fix psignal prototype


The prototype for the libiberty's implementation of psignal seems to be
incorrect: BSDs have traditionally used a signed int for the signo
parameter (as I discovered by reading the psignal man page of numerous
different UNIX systems on the web).  By changing this, we eliminate a
signed/unsigned comparison warning in libiberty.

I also fixed a typo I found while reading the code.

Okay for the trunk?


2007-01-31  Ben Elliston  <bje@au.ibm.com>

        * strsignal.c (psignal): Change type of signo to int.
        * functions.texi: Regenerate.

Index: strsignal.c
===================================================================
--- strsignal.c (revision 121360)
+++ strsignal.c (working copy)
@@ -9,7 +9,7 @@
 /* We need to declare sys_siglist, because even if the system provides
    it we can't assume that it is declared in <signal.h> (for example,
    SunOS provides sys_siglist, but it does not declare it in any
-   header file).  fHowever, we can't declare sys_siglist portably,
+   header file).  However, we can't declare sys_siglist portably,
    because on some systems it is declared with const and on some
    systems it is declared without const.  If we were using autoconf,
    we could work out the right declaration.  Until, then we just
@@ -536,7 +536,7 @@ strtosigno (const char *name)
 
 /*
 
-@deftypefn Supplemental void psignal (unsigned @var{signo}, char *@var{message})
+@deftypefn Supplemental void psignal (int @var{signo}, char *@var{message})
 
 Print @var{message} to the standard error, followed by a colon,
 followed by the description of the signal specified by @var{signo},
@@ -549,7 +549,7 @@ followed by a newline.
 #ifndef HAVE_PSIGNAL
 
 void
-psignal (unsigned signo, char *message)
+psignal (int signo, char *message)
 {
   if (signal_names == NULL)
     {
Index: functions.texi
===================================================================
--- functions.texi      (revision 121360)
+++ functions.texi      (working copy)
@@ -948,7 +948,7 @@ documented.
 @end deftypefn
 
 @c strsignal.c:539
-@deftypefn Supplemental void psignal (unsigned @var{signo}, char *@var{message})
+@deftypefn Supplemental void psignal (int @var{signo}, char *@var{message})
 
 Print @var{message} to the standard error, followed by a colon,
 followed by the description of the signal specified by @var{signo},



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