Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Fix compilation of 64-bit gdb 7.7 on Solaris
@ 2014-02-06 16:17 Rainer Orth
  2014-02-06 17:02 ` Pedro Alves
  0 siblings, 1 reply; 11+ messages in thread
From: Rainer Orth @ 2014-02-06 16:17 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 724 bytes --]

Compiling a 64-bit gdb 7.7 on Solaris (8 to 11) with gcc fails in bfd:

cc1: warnings being treated as errors
/vol/src/gnu/gdb/gdb-7.7/bfd/cache.c: In function 'bfd_cache_max_open':
/vol/src/gnu/gdb/gdb-7.7/bfd/cache.c:85: error: comparison between signed and unsigned integer expressions

This is about

	  && rlim.rlim_cur != RLIM_INFINITY)

where <sys/resource.h> has

typedef unsigned long   rlim_t;
#define RLIM_INFINITY   (-3l)

While I've raised the issue with Oracle, the problem can easily be
avoided by casting RLIM_INFINITY to rlim_t, as the following patch does.

Ok for mainline?

	Rainer


2014-02-06  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* cache.c (bfd_cache_max_open): Case RLIM_INFINITY to rlim_t.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: bfd-cache.patch --]
[-- Type: text/x-patch, Size: 374 bytes --]

--- bfd/cache.c	2013/12/08 04:55:47	1.1
+++ bfd/cache.c	2014/02/06 16:13:27
@@ -82,7 +82,7 @@ bfd_cache_max_open (void)
 #ifdef HAVE_GETRLIMIT
       struct rlimit rlim;
       if (getrlimit (RLIMIT_NOFILE, &rlim) == 0
-	  && rlim.rlim_cur != RLIM_INFINITY)
+	  && rlim.rlim_cur != (rlim_t) RLIM_INFINITY)
 	max = rlim.rlim_cur / 8;
       else
 #endif /* HAVE_GETRLIMIT */

[-- Attachment #3: Type: text/plain, Size: 143 bytes --]


-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-02-11  2:20 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-06 16:17 Fix compilation of 64-bit gdb 7.7 on Solaris Rainer Orth
2014-02-06 17:02 ` Pedro Alves
2014-02-07 10:07   ` Rainer Orth
2014-02-07 14:55   ` Rainer Orth
2014-02-07 15:29     ` Pedro Alves
2014-02-07 15:30     ` Joel Brobecker
2014-02-07 15:48       ` Rainer Orth
2014-02-07 17:19         ` Joel Brobecker
2014-02-07 20:44           ` Tom Tromey
2014-02-10 15:47           ` Rainer Orth
2014-02-11  2:20             ` Joel Brobecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox