Thread overview
Re: DMD git HEAD not compilable on gcc 6.1
Aug 10, 2016
H. S. Teoh
Aug 10, 2016
ketmar
Aug 11, 2016
Jacob Carlborg
August 10, 2016
On Wed, Aug 10, 2016 at 11:13:28PM +0200, Jacob Carlborg via Digitalmars-d wrote:
> On 10/08/16 23:01, H. S. Teoh via Digitalmars-d wrote:
> > https://issues.dlang.org/show_bug.cgi?id=16373
> > 
> > :-(
> > 
> > Anybody know a quick fix for this?
> 
> Disable the warning printed in the error message.
[...]

Turns out, it's a messy situation related to the makefiles. :-(

The required -Wnarrowing flag is already specified for gcc-based host compilers; however, the makefile uses an unreliable string matching of the compiler's --version output to detect gcc-based compilers. Unfortunately, my distro (Debian) uses a custom gcc build that, for whatever reason, doesn't include the string "gcc" in the output of --version, so the makefile fails to detect gcc and doesn't include the needed flag.

Is there a more reliable way to detect gcc-based compilers other than string-matching of --version?  Perhaps a small utility program that uses #ifdef __GNUC__ as a far more reliable compiler detection method?


T

-- 
Unix was not designed to stop people from doing stupid things, because that would also stop them from doing clever things. -- Doug Gwyn
August 10, 2016
On Wednesday, 10 August 2016 at 21:19:14 UTC, H. S. Teoh wrote:
> Is there a more reliable way to detect gcc-based compilers other than string-matching of --version?  Perhaps a small utility program that uses #ifdef __GNUC__ as a far more reliable compiler detection method?

it is not more reliable. other compilers may define that if they are trying to "mimic" gcc for some reason. i'd say "spam your distributive maintainers to fix their bug".
August 11, 2016
On 10/08/16 23:19, H. S. Teoh via Digitalmars-d wrote:

> Turns out, it's a messy situation related to the makefiles. :-(

Can't you do something like "CFLAGS='-Wno-narrowing' make -f posix.mak"?

-- 
/Jacob Carlborg