Discussion:
[Bug gdb/22098] New: failed to build with mingw 5.1.0
alfedotov at gmail dot com
2017-09-06 16:35:35 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=22098

Bug ID: 22098
Summary: failed to build with mingw 5.1.0
Product: gdb
Version: 8.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: gdb
Assignee: unassigned at sourceware dot org
Reporter: alfedotov at gmail dot com
Target Milestone: ---

gcc version 5.1.0 20150422 (Fedora MinGW 5.1.0-2.fc22) (GCC)

../../src_gdb/gdb/arm-linux-tdep.c:394:1: error: narrowing conversion of '-1'
from 'int' to 'ULONGEST {aka long long unsigned int}' inside { }
};
^
../../src_gdb/gdb/arm-linux-tdep.c:394:1: error: narrowing conversion of '-1ll'
from 'LONGEST {aka long long int}' to 'ULONGEST {aka long long unsigned int}'
inside { }
../../src_gdb/gdb/arm-linux-tdep.c:404:1: error: narrowing conversion of '-1'
from 'int' to 'ULONGEST {aka long long unsigned int}' inside { }
};
^
../../src_gdb/gdb/arm-linux-tdep.c:404:1: error: narrowing conversion of '-1ll'
from 'LONGEST {aka long long int}' to 'ULONGEST {aka long long unsigned int}'
inside { }
../../src_gdb/gdb/arm-linux-tdep.c:415:1: error: narrowing conversion of '-1'
from 'int' to 'ULONGEST {aka long long unsigned int}' inside { }
};
^
../../src_gdb/gdb/arm-linux-tdep.c:415:1: error: narrowing conversion of '-1'
from 'int' to 'ULONGEST {aka long long unsigned int}' inside { }
../../src_gdb/gdb/arm-linux-tdep.c:415:1: error: narrowing conversion of '-1ll'
from 'LONGEST {aka long long int}' to 'ULONGEST {aka long long unsigned int}'
inside { }
../../src_gdb/gdb/arm-linux-tdep.c:426:1: error: narrowing conversion of '-1'
from 'int' to 'ULONGEST {aka long long unsigned int}' inside { }
};
^
../../src_gdb/gdb/arm-linux-tdep.c:426:1: error: narrowing conversion of '-1'
from 'int' to 'ULONGEST {aka long long unsigned int}' inside { }
../../src_gdb/gdb/arm-linux-tdep.c:426:1: error: narrowing conversion of '-1ll'
from 'LONGEST {aka long long int}' to 'ULONGEST {aka long long unsigned int}'
inside { }
../../src_gdb/gdb/arm-linux-tdep.c:438:1: error: narrowing conversion of '-1'
from 'int' to 'ULONGEST {aka long long unsigned int}' inside { }
};
^
../../src_gdb/gdb/arm-linux-tdep.c:438:1: error: narrowing conversion of '-1'
from 'int' to 'ULONGEST {aka long long unsigned int}' inside { }
../../src_gdb/gdb/arm-linux-tdep.c:438:1: error: narrowing conversion of '-1'
from 'int' to 'ULONGEST {aka long long unsigned int}' inside { }
../../src_gdb/gdb/arm-linux-tdep.c:438:1: error: narrowing conversion of '-1ll'
from 'LONGEST {aka long long int}' to 'ULONGEST {aka long long unsigned int}'
inside { }
../../src_gdb/gdb/arm-linux-tdep.c:450:1: error: narrowing conversion of '-1'
from 'int' to 'ULONGEST {aka long long unsigned int}' inside { }
};
^
../../src_gdb/gdb/arm-linux-tdep.c:450:1: error: narrowing conversion of '-1'
from 'int' to 'ULONGEST {aka long long unsigned int}' inside { }
../../src_gdb/gdb/arm-linux-tdep.c:450:1: error: narrowing conversion of '-1'
from 'int' to 'ULONGEST {aka long long unsigned int}' inside { }
../../src_gdb/gdb/arm-linux-tdep.c:450:1: error: narrowing conversion of '-1ll'
from 'LONGEST {aka long long int}' to 'ULONGEST {aka long long unsigned int}'
inside { }
../../src_gdb/gdb/arm-linux-tdep.c:461:1: error: narrowing conversion of '-1'
from 'int' to 'ULONGEST {aka long long unsigned int}' inside { }
};
^
../../src_gdb/gdb/arm-linux-tdep.c:461:1: error: narrowing conversion of '-1'
from 'int' to 'ULONGEST {aka long long unsigned int}' inside { }
../../src_gdb/gdb/arm-linux-tdep.c:461:1: error: narrowing conversion of '-1ll'
from 'LONGEST {aka long long int}' to 'ULONGEST {aka long long unsigned int}'
inside { }
../../src_gdb/gdb/arm-linux-tdep.c:472:1: error: narrowing conversion of '-1'
from 'int' to 'ULONGEST {aka long long unsigned int}' inside { }
};
^
--
You are receiving this mail because:
You are on the CC list for the bug.
alfedotov at gmail dot com
2017-09-07 09:00:57 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=22098

Alexander Fedotov <alfedotov at gmail dot com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Component|gdb |build

--- Comment #1 from Alexander Fedotov <alfedotov at gmail dot com> ---
Environment is:
Fedora 4.4.14-200.fc22.x86_64 #1 SMP Fri Jun 24 21:19:33 UTC 2016 x86_64 x86_64
x86_64 GNU/Linux
gcc version 5.1.0 20150422 (Fedora MinGW 5.1.0-2.fc22) (GCC)


../../src_gdb/gdb/aarch64-tdep.c: In function 'VEC_CORE_ADDR*
aarch64_software_single_step(regcache*)':
../../src_gdb/gdb/aarch64-tdep.c:2428:34: error: narrowing conversion of '-1'
from 'int' to 'CORE_ADDR {aka long long unsigned int}' inside { }
CORE_ADDR breaks[2] = { -1, -1 };
^
../../src_gdb/gdb/aarch64-tdep.c:2428:34: error: narrowing conversion of '-1'
from 'int' to 'CORE_ADDR {aka long long unsigned int}' inside { }
Makefile:1876: recipe for target 'aarch64-tdep.o' failed
--
You are receiving this mail because:
You are on the CC list for the bug.
tromey at sourceware dot org
2018-04-19 15:19:21 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=22098

Tom Tromey <tromey at sourceware dot org> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |tromey at sourceware dot org

--- Comment #2 from Tom Tromey <tromey at sourceware dot org> ---
Is this still a problem?
--
You are receiving this mail because:
You are on the CC list for the bug.
palves at redhat dot com
2018-04-19 15:41:34 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=22098

Pedro Alves <palves at redhat dot com> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |palves at redhat dot com

--- Comment #3 from Pedro Alves <palves at redhat dot com> ---
I'm surprised anyone sees this, since we supposedly build with
"-Wno-narrowing".
Maybe that ended up missing from the gcc invocations for some reason?

Pedantically, the narrowing conversions are undefined C++11, and -Wno-narrowing
was added very early on C++ conversion to make the compiler less pedantic
(https://sourceware.org/ml/gdb-patches/2015-02/msg00203.html, whoops, we
require C++11 nowadays. :-)). I don't think any compiler is going to
miscompile that.

We could fix that with either explict casting at each call site:

CORE_ADDR breaks[2] = { (CORE_ADDR) -1, (CORE_ADDR) -1 };

Or perhaps better add a CORE_ADDR_MAX and use it throughout:

#define CORE_ADDR_MAX ((CORE_ADDR) -1)

CORE_ADDR breaks[2] = { CORE_ADDR_MAX, CORE_ADDR_MAX };
--
You are receiving this mail because:
You are on the CC list for the bug.
palves at redhat dot com
2018-04-19 15:51:35 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=22098

Pedro Alves <palves at redhat dot com> changed:

What |Removed |Added
----------------------------------------------------------------------------
See Also| |https://sourceware.org/bugz
| |illa/show_bug.cgi?id=23087

--- Comment #4 from Pedro Alves <palves at redhat dot com> ---
I've filed https://sourceware.org/bugzilla/show_bug.cgi?id=23087 to track the
elimination of -Wno-narrowing.
--
You are receiving this mail because:
You are on the CC list for the bug.
tnfchris at sourceware dot org
2018-05-15 17:28:54 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=22098

Tamar Christina <tnfchris at sourceware dot org> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |tnfchris at sourceware dot org
Assignee|unassigned at sourceware dot org |tnfchris at sourceware dot org
--
You are receiving this mail because:
You are on the CC list for the bug.
tnfchris at sourceware dot org
2018-05-15 17:29:45 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=22098

Tamar Christina <tnfchris at sourceware dot org> changed:

What |Removed |Added
----------------------------------------------------------------------------
Assignee|tnfchris at sourceware dot org |unassigned at sourceware dot org
--
You are receiving this mail because:
You are on the CC list for the bug.
tromey at sourceware dot org
2018-08-07 12:50:27 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=22098

Tom Tromey <tromey at sourceware dot org> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |DUPLICATE

--- Comment #5 from Tom Tromey <tromey at sourceware dot org> ---
No response from the reporter, and we have a bug to remove
the underlying problem. I'm going to mark this as a dup since
it seems like the same basic bug.

*** This bug has been marked as a duplicate of bug 23087 ***
--
You are receiving this mail because:
You are on the CC list for the bug.
Loading...