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

[Bug build/23087] Stop relying on -Wno-narrowing


https://sourceware.org/bugzilla/show_bug.cgi?id=23087

--- Comment #5 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Rainer Orth <ro@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=206c1947c1cb8e4ac6abb8e6803c762200167cde

commit 206c1947c1cb8e4ac6abb8e6803c762200167cde
Author: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Date:   Tue Sep 18 09:14:11 2018 +0200

    Cast RLIM_INFINITY to rlim_t to fix 64-bit Solaris 10 build

    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.

        * utils.c (dump_core) [HAVE_SETRLIMIT]: Cast RLIM_INFINITY to
        rlim_t.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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