From patchwork Mon Sep 17 13:34:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 29418 Received: (qmail 99558 invoked by alias); 17 Sep 2018 13:34:33 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 99404 invoked by uid 89); 17 Sep 2018 13:34:31 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-19.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY autolearn=ham version=3.3.2 spammy=Wno-narrowing, wno-narrowing, wnonarrowing, Wnonarrowing X-HELO: smtp.CeBiTec.Uni-Bielefeld.DE Received: from smtp.CeBiTec.Uni-Bielefeld.DE (HELO smtp.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 17 Sep 2018 13:34:30 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id AF649B18 for ; Mon, 17 Sep 2018 15:34:27 +0200 (CEST) Received: from smtp.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id m90mZJSc2b-q for ; Mon, 17 Sep 2018 15:34:25 +0200 (CEST) Received: from lokon.CeBiTec.Uni-Bielefeld.DE (lokon.CeBiTec.Uni-Bielefeld.DE [129.70.161.152]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id 99132B14 for ; Mon, 17 Sep 2018 15:34:25 +0200 (CEST) Received: (from ro@localhost) by lokon.CeBiTec.Uni-Bielefeld.DE (8.15.2+Sun/8.15.2/Submit) id w8HDYPRw018620; Mon, 17 Sep 2018 15:34:25 +0200 (MEST) From: Rainer Orth To: gdb-patches@sourceware.org Subject: [PATCH] Cast RLIM_INFINITY to rlim_t to fix 64-bit Solaris 10 build Date: Mon, 17 Sep 2018 15:34:25 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (usg-unix-v) MIME-Version: 1.0 X-IsSubscribed: yes 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 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 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 # 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 */