* [PATCH] Cast RLIM_INFINITY to rlim_t to fix 64-bit Solaris 10 build
@ 2018-09-17 13:34 Rainer Orth
2018-09-17 13:41 ` Tom Tromey
0 siblings, 1 reply; 2+ messages in thread
From: Rainer Orth @ 2018-09-17 13:34 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 1385 bytes --]
gdb doesn't currently build on 64-bit Solaris 10:
/vol/src/gnu/gdb/hg/master/local/gdb/utils.c: In function ‘void dump_core()’:
/vol/src/gnu/gdb/hg/master/local/gdb/utils.c:223:55: error: narrowing conversion
of ‘-3’ from ‘long int’ to ‘rlim_t’ {aka ‘long unsigned int’} inside {
} [-Wnarrowing]
struct rlimit rlim = { RLIM_INFINITY, RLIM_INFINITY };
^
/vol/src/gnu/gdb/hg/master/local/gdb/utils.c:223:55: error: narrowing conversion
of ‘-3’ from ‘long int’ to ‘rlim_t’ {aka ‘long unsigned int’} inside {
} [-Wnarrowing]
This was introduced by
2018-08-27 Tom Tromey <tom@tromey.com>
PR build/23087:
* configure: Rebuild.
* warning.m4 (AM_GDB_WARNINGS): Remove -Wno-narrowing.
and can be fixed by the following patch.
Solaris 11 isn't affected because there <sys/resource.h> has
#define RLIM_INFINITY ((rlim_t)-3l)
instead of
#define RLIM_INFINITY (-3l)
on Solaris 10.
Tested on amd64-pc-solaris2.10 and amd64-pc-solaris2.11. Ok for master?
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
2018-09-17 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* utils.c (dump_core) [HAVE_SETRLIMIT]: Cast RLIM_INFINITY to
rlim_t.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: sol10-rlim_inifinity.patch --]
[-- Type: text/x-patch, Size: 477 bytes --]
# HG changeset patch
# Parent e76ee5ead0d6305ffdac7965cf62a7b8b1ae5d36
Cast RLIM_INFINITY to rlim_t to fix 64-bit Solaris 10 build
diff --git a/gdb/utils.c b/gdb/utils.c
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -220,7 +220,7 @@ void
dump_core (void)
{
#ifdef HAVE_SETRLIMIT
- struct rlimit rlim = { RLIM_INFINITY, RLIM_INFINITY };
+ struct rlimit rlim = { (rlim_t) RLIM_INFINITY, (rlim_t) RLIM_INFINITY };
setrlimit (RLIMIT_CORE, &rlim);
#endif /* HAVE_SETRLIMIT */
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Cast RLIM_INFINITY to rlim_t to fix 64-bit Solaris 10 build
2018-09-17 13:34 [PATCH] Cast RLIM_INFINITY to rlim_t to fix 64-bit Solaris 10 build Rainer Orth
@ 2018-09-17 13:41 ` Tom Tromey
0 siblings, 0 replies; 2+ messages in thread
From: Tom Tromey @ 2018-09-17 13:41 UTC (permalink / raw)
To: Rainer Orth; +Cc: gdb-patches
>>>>> "Rainer" == Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:
Rainer> 2018-09-17 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Rainer> * utils.c (dump_core) [HAVE_SETRLIMIT]: Cast RLIM_INFINITY to
Rainer> rlim_t.
This is ok. Thank you for fixing this.
Tom
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-09-17 13:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-17 13:34 [PATCH] Cast RLIM_INFINITY to rlim_t to fix 64-bit Solaris 10 build Rainer Orth
2018-09-17 13:41 ` Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).