RejectedSoftware Forums

Sign up

Strange compiler error

After an update, dmd produces the error message

/usr/include/dlang/dmd/std/socket.d(1681,21): Error: ntohl cannot be interpreted at compile time, because it has no available source code
/usr/include/dlang/dmd/std/socket.d(1563,28):        called from here: parse(addr)

My vibe (dub.sdl):

dependency "vibe-d" version="~>0.8.3"

My environment:

$ dmd --version
DMD64 D Compiler v2.079.0
Copyright (C) 1999-2018 by The D Language Foundation, All Rights Reserved written by Walter Bright

$ dub --version
DUB version 1.8.0, built on Mar  3 2018

$ uname --all
Linux abe 4.15.15-1-ARCH #1 SMP PREEMPT Sat Mar 31 23:59:25 UTC 2018 x86_64 GNU/Linux

This issue is on a production machine.. any help would be greatly appreciated.

Thank you

Re: Strange compiler error

On Mon, 09 Apr 2018 10:07:31 GMT, Orfeo wrote:

After an update, dmd produces the error message

/usr/include/dlang/dmd/std/socket.d(1681,21): Error: ntohl cannot be interpreted at compile time, because it has no available source code
/usr/include/dlang/dmd/std/socket.d(1563,28):        called from here: parse(addr)

My vibe (dub.sdl):

dependency "vibe-d" version="~>0.8.3"

My environment:

$ dmd --version
DMD64 D Compiler v2.079.0
Copyright (C) 1999-2018 by The D Language Foundation, All Rights Reserved written by Walter Bright

$ dub --version
DUB version 1.8.0, built on Mar  3 2018

$ uname --all
Linux abe 4.15.15-1-ARCH #1 SMP PREEMPT Sat Mar 31 23:59:25 UTC 2018 x86_64 GNU/Linux

This issue is on a production machine.. any help would be greatly appreciated.

Thank you

It seems like resolveHost may be called somewhere in a CTFE context. I'm not sure why that would have worked previously, but the change to use std.socket.parseAddress has been done recently with the switch to vibe-core. Can you share the code that leads up to the ntohl call (i.e. the vibe.core.net.resolveHost call if that is actually the reason)?