bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SIGRTMIN on OSF/1 5.1


From: Bruno Haible
Subject: SIGRTMIN on OSF/1 5.1
Date: Mon, 20 Dec 2010 01:53:52 +0100
User-agent: KMail/1.9.9

On OSF/1 5.1, I'm seeing this warning:

  strsignal.c: In function 'strsignal':
  strsignal.c:111: warning: format '%d' expects type 'int', but argument 4 has 
type 'long int'

The reason is that while POSIX says that SIGRTMIN and SIGRTMAX expand to
an expression of type 'int', on this platform it's an expression of type
'long'.

It would be a bit complicated to work around it directly in our <signal.h>
replacement, and these macros are not frequently used. Therefore I'm
putting the workaround in strsignal.c, not in signal.in.h.


2010-12-19  Bruno Haible  <address@hidden>

        signal: Document problem with type of SIGRTMIN, SIGRTMAX on OSF/1 5.1.
        * doc/posix-headers/signal.texi: Document OSF/1 5.1 problem.
        * lib/strsignal.c (strsignal): Cast SIGRTMIN to 'int'.

--- doc/posix-headers/signal.texi.orig  Mon Dec 20 01:48:38 2010
+++ doc/posix-headers/signal.texi       Mon Dec 20 01:48:30 2010
@@ -35,4 +35,8 @@
 @item
 Many signals are not defined on some platforms:
 mingw.
address@hidden
+The macros @code{SIGRTMIN} and @code{SIGRTMAX} expand to an expression of type
address@hidden instead of @code{int} on some platforms:
+OSF/1 5.1.
 @end itemize
--- lib/strsignal.c.orig        Mon Dec 20 01:48:38 2010
+++ lib/strsignal.c     Mon Dec 20 01:46:45 2010
@@ -108,7 +108,7 @@
 #ifdef SIGRTMIN
       if (signum >= SIGRTMIN && signum <= SIGRTMAX)
         len = __snprintf (buffer, BUFFERSIZ - 1, _("Real-time signal %d"),
-                          signum - SIGRTMIN);
+                          signum - (int) SIGRTMIN);
       else
 #endif
         len = __snprintf (buffer, BUFFERSIZ - 1, _("Unknown signal %d"),



reply via email to

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