Bug 16373 – gcc 6.1.1 compatibility

Status
RESOLVED
Resolution
WORKSFORME
Severity
blocker
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2016-08-10T21:06:00Z
Last change time
2017-06-26T00:41:51Z
Assigned to
nobody
Creator
hsteoh

Comments

Comment #0 by hsteoh — 2016-08-10T21:06:57Z
DMD does not compile with gcc 6.1.1: backend/cg87.c:716:46: error: narrowing conversion of ‘232’ from ‘int’ to ‘char’ inside { } [-Wnarrowing] backend/cod1.c:2508:9: error: narrowing conversion of ‘193’ from ‘int’ to ‘char’ inside { } [-Wnarrowing] backend/cod3.c:431:13: error: narrowing conversion of ‘144’ from ‘int’ to ‘char’ inside { } [-Wnarrowing] backend/ptrntab.c:1208:1: error: narrowing conversion of ‘-1006567058’ from ‘int’ to ‘unsigned int’ inside { } [-Wnarrowing] [... above error repeated on many other lines in the same file ...] These errors are making it impossible for me to use dmd git HEAD.
Comment #1 by hsteoh — 2016-08-10T21:28:47Z
Turns out the problem is that posix.mak fails to reliably detect gcc. Propose using a small utility program that uses #ifdef __GNUC__ as a more reliable detection method: http://nadeausoftware.com/articles/2012/10/c_c_tip_how_detect_compiler_name_and_version_using_compiler_predefined_macros#Howtodetectthecompilername
Comment #2 by dlang-bugzilla — 2017-06-26T00:41:51Z
I can build dmd fine today with gcc (GCC) 6.3.1 20170306, so I assume this has since been fixed.