www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - error importing std.intrinsic on linux Digital Mars D Compiler v2.008

reply Guillaume Chatelet <chatelet.guillaume gmail.com> writes:
I'm trying to build the following helloworld on Linux Gentoo :

 import std.stdio;
void main () { writefln("hello world !!"); } invoking 'dmd hello.d -v' gives
 parse     hello
semantic hello import object (/opt/dmd/src/phobos/object.d) import std.stdio (/opt/dmd/src/phobos/std/stdio.d) import std.c.stdio (/opt/dmd/src/phobos/std/c/stdio.d) import std.c.stddef (/opt/dmd/src/phobos/std/c/stddef.d) import std.c.stdarg (/opt/dmd/src/phobos/std/c/stdarg.d) import std.format (/opt/dmd/src/phobos/std/format.d) import std.stdarg (/opt/dmd/src/phobos/std/stdarg.d) import std.utf (/opt/dmd/src/phobos/std/utf.d) import std.contracts (/opt/dmd/src/phobos/std/contracts.d) import std.conv (/opt/dmd/src/phobos/std/conv.d) /opt/dmd/src/phobos/std/conv.d(1468): number is not representable import std.string (/opt/dmd/src/phobos/std/string.d) import std.c.stdlib (/opt/dmd/src/phobos/std/c/stdlib.d) import std.c.string (/opt/dmd/src/phobos/std/c/string.d) import std.uni (/opt/dmd/src/phobos/std/uni.d) import std.array (/opt/dmd/src/phobos/std/array.d) import std.ctype (/opt/dmd/src/phobos/std/ctype.d) import std.typetuple (/opt/dmd/src/phobos/std/typetuple.d) import std.traits (/opt/dmd/src/phobos/std/traits.d) import std.math (/opt/dmd/src/phobos/std/math.d) /opt/dmd/src/phobos/std/math.d(703): number is not representable import std.c.math (/opt/dmd/src/phobos/std/c/math.d) import std.system (/opt/dmd/src/phobos/std/system.d) import std.gc (/opt/dmd/src/phobos/std/gc.d) import gcstats (/opt/dmd/src/phobos/gcstats.d) import std.file (/opt/dmd/src/phobos/std/file.d) import std.path (/opt/dmd/src/phobos/std/path.d) import std.c.linux.linux (/opt/dmd/src/phobos/std/c/linux/linux.d) import std.c.linux.linuxextern
 (/opt/dmd/src/phobos/std/c/linux/linuxextern.d)
import std.c.linux.pthread (/opt/dmd/src/phobos/std/c/linux/pthread.d) import std.intrinsic (/opt/dmd/src/phobos/std/intrinsic.d) /opt/dmd/src/phobos/std/c/linux/linux.d(444): Error: Integer constant
 expression expected instead of _SIGSET_NWORDS
/opt/dmd/src/phobos/std/c/linux/linux.d(444): Error: Integer constant
 expression expected instead of _SIGSET_NWORDS
/opt/dmd/src/phobos/std/c/linux/linux.d(444): Error: Integer constant
 expression expected instead of _SIGSET_NWORDS
/opt/dmd/src/phobos/std/c/linux/linux.d(444): Error: Integer constant
 expression expected instead of _SIGSET_NWORDS
import std.outofmemory (/opt/dmd/src/phobos/std/outofmemory.d) import std.regexp (/opt/dmd/src/phobos/std/regexp.d) import std.outbuffer (/opt/dmd/src/phobos/std/outbuffer.d) import std.bitmanip (/opt/dmd/src/phobos/std/bitmanip.d) import std.metastrings (/opt/dmd/src/phobos/std/metastrings.d) DMD version is v2.008, gentoo ebuild is dev-lang/dmd-bin-2.008-r1 The relevant lines in linux.d file are, l.444 is 'uint[_SIGSET_NWORDS] __val;'
 extern (C)
{ /* from <pwd.h> */
     struct passwd
{ char *pw_name; char *pw_passwd; uid_t pw_uid; gid_t pw_gid; char *pw_gecos; char *pw_dir; char *pw_shell; }
     const size_t _SIGSET_NWORDS = 1024 / (8 * uint.sizeof);
struct sigset_t { uint[_SIGSET_NWORDS] __val; }
     int getpwnam_r(const(char)*, passwd*, void*, size_t, passwd**);
passwd* getpwnam(in char*); passwd* getpwuid(uid_t); int getpwuid_r(uid_t, passwd*, char*, size_t, passwd**); int kill(pid_t, int); int sem_close(sem_t*); int sigemptyset(sigset_t*); int sigfillset(sigset_t*); int sigismember(sigset_t*, int); int sigsuspend(sigset_t*); } My linux kernel version is 2.6.35-gentoo-r10, the _SIGSET_NWORDS constant is defined in '/usr/include/bits/sigset.h' and value is

Is it serious doc ? Guillaume Chatelet
Oct 30 2010
parent reply Guillaume Chatelet <chatelet.guillaume gmail.com> writes:
Alright my first post is almost unreadable so restarting with the http
version...
Hope it's going to be better.

Guillaume
---------

I'm trying to build the following helloworld on Linux Gentoo :
import std.stdio;
void main ()
{
    writefln("hello world !!");
}

invoking 'dmd hello.d -v' gives :
parse     hello
semantic  hello
import    object        (/opt/dmd/src/phobos/object.d)
import    std.stdio     (/opt/dmd/src/phobos/std/stdio.d)
import    std.c.stdio   (/opt/dmd/src/phobos/std/c/stdio.d)
import    std.c.stddef  (/opt/dmd/src/phobos/std/c/stddef.d)
import    std.c.stdarg  (/opt/dmd/src/phobos/std/c/stdarg.d)
import    std.format    (/opt/dmd/src/phobos/std/format.d)
import    std.stdarg    (/opt/dmd/src/phobos/std/stdarg.d)
import    std.utf       (/opt/dmd/src/phobos/std/utf.d)
import    std.contracts (/opt/dmd/src/phobos/std/contracts.d)
import    std.conv      (/opt/dmd/src/phobos/std/conv.d)
/opt/dmd/src/phobos/std/conv.d(1468): number is not representable
import    std.string    (/opt/dmd/src/phobos/std/string.d)
import    std.c.stdlib  (/opt/dmd/src/phobos/std/c/stdlib.d)
import    std.c.string  (/opt/dmd/src/phobos/std/c/string.d)
import    std.uni       (/opt/dmd/src/phobos/std/uni.d)
import    std.array     (/opt/dmd/src/phobos/std/array.d)
import    std.ctype     (/opt/dmd/src/phobos/std/ctype.d)
import    std.typetuple (/opt/dmd/src/phobos/std/typetuple.d)
import    std.traits    (/opt/dmd/src/phobos/std/traits.d)
import    std.math      (/opt/dmd/src/phobos/std/math.d)
/opt/dmd/src/phobos/std/math.d(703): number is not representable
import    std.c.math    (/opt/dmd/src/phobos/std/c/math.d)
import    std.system    (/opt/dmd/src/phobos/std/system.d)
import    std.gc        (/opt/dmd/src/phobos/std/gc.d)
import    gcstats       (/opt/dmd/src/phobos/gcstats.d)
import    std.file      (/opt/dmd/src/phobos/std/file.d)
import    std.path      (/opt/dmd/src/phobos/std/path.d)
import    std.c.linux.linux     (/opt/dmd/src/phobos/std/c/linux/linux.d)
import    std.c.linux.linuxextern      
(/opt/dmd/src/phobos/std/c/linux/linuxextern.d)
import    std.c.linux.pthread   (/opt/dmd/src/phobos/std/c/linux/pthread.d)
import    std.intrinsic (/opt/dmd/src/phobos/std/intrinsic.d)
/opt/dmd/src/phobos/std/c/linux/linux.d(444): Error: Integer constant
expression expected instead of _SIGSET_NWORDS
/opt/dmd/src/phobos/std/c/linux/linux.d(444): Error: Integer constant
expression expected instead of _SIGSET_NWORDS
/opt/dmd/src/phobos/std/c/linux/linux.d(444): Error: Integer constant
expression expected instead of _SIGSET_NWORDS
/opt/dmd/src/phobos/std/c/linux/linux.d(444): Error: Integer constant
expression expected instead of _SIGSET_NWORDS
import    std.outofmemory       (/opt/dmd/src/phobos/std/outofmemory.d)
import    std.regexp    (/opt/dmd/src/phobos/std/regexp.d)
import    std.outbuffer (/opt/dmd/src/phobos/std/outbuffer.d)
import    std.bitmanip  (/opt/dmd/src/phobos/std/bitmanip.d)
import    std.metastrings       (/opt/dmd/src/phobos/std/metastrings.d)


DMD version is v2.008, gentoo ebuild is dev-lang/dmd-bin-2.008-r1
The relevant lines in linux.d file are, l.444 is 'uint[_SIGSET_NWORDS] __val;'


extern (C)
{
    /* from <pwd.h>
     */

    struct passwd
    {
        char *pw_name;
        char *pw_passwd;
        uid_t pw_uid;
        gid_t pw_gid;
        char *pw_gecos;
        char *pw_dir;
        char *pw_shell;
    }

    const size_t _SIGSET_NWORDS = 1024 / (8 * uint.sizeof);
    struct sigset_t
    {
        uint[_SIGSET_NWORDS] __val;
    }

    int getpwnam_r(const(char)*, passwd*, void*, size_t, passwd**);
    passwd* getpwnam(in char*);
    passwd* getpwuid(uid_t);
    int getpwuid_r(uid_t, passwd*, char*, size_t, passwd**);
    int kill(pid_t, int);
    int sem_close(sem_t*);
    int sigemptyset(sigset_t*);
    int sigfillset(sigset_t*);
    int sigismember(sigset_t*, int);
    int sigsuspend(sigset_t*);
}


My linux kernel version is 2.6.35-gentoo-r10, the _SIGSET_NWORDS constant is
defined in '/usr/include/bits/sigset.h' and value is


Is it serious doc ?

Guillaume Chatelet
Oct 30 2010
parent reply Don <nospam nospam.com> writes:
Guillaume Chatelet wrote:
 Alright my first post is almost unreadable so restarting with the http
version...
 Hope it's going to be better.
Why are you using version 2.008??? It was one of the first 'proof of concept' alpha test versions. It wasn't intended for serious use. Any version prior to about 2.040 was useful only for finding the most severe compiler bugs.
Oct 30 2010
next sibling parent Guillaume Chatelet <chatelet.guillaume gmail.com> writes:
On Sat, Oct 30, 2010 at 3:33 PM, Don <nospam nospam.com> wrote:

 Guillaume Chatelet wrote:

 Alright my first post is almost unreadable so restarting with the http
 version...
 Hope it's going to be better.
Why are you using version 2.008??? It was one of the first 'proof of concept' alpha test versions. It wasn't intended for serious use. Any version prior to about 2.040 was useful only for finding the most severe compiler bugs.
Thx Don for the reply. It actually is the only version available for Gentoo right now, so I'm going to see if anyone's interested in bringing a more recent version of DMD for this distribution.
Oct 30 2010
prev sibling parent reply Jonathan M Davis <jmdavisProg gmx.com> writes:
On Saturday 30 October 2010 07:33:05 Guillaume Chatelet wrote:
 On Sat, Oct 30, 2010 at 3:33 PM, Don <nospam nospam.com> wrote:
 Guillaume Chatelet wrote:
 Alright my first post is almost unreadable so restarting with the http
 version...
 Hope it's going to be better.
Why are you using version 2.008??? It was one of the first 'proof of concept' alpha test versions. It wasn't intended for serious use. Any version prior to about 2.040 was useful only for finding the most severe compiler bugs.
Thx Don for the reply. It actually is the only version available for Gentoo right now, so I'm going to see if anyone's interested in bringing a more recent version of DMD for this distribution.
Just download the zip file. It's easy to to just put it in your home directory somewhere and use it. Sure, it would be great if gentoo got a more up-to-date version, but you can just download it yourself and use it quite easily, and it's self-contained if you don't copy the files to /usr/bin and the like, so uninstalling it later is a breeze. - Jonathan M Davis P.S. The Bug listed isn't really intended to be posted to. The bug tracker sends notifications to this list and you sign up for the list if you want those notifications. You should be posting to one of the other lists like Learn or D. And if you have a bug that you want to report rather than looking for help on something, you can just report it to the tracker: http://d.puremagic.com/issues/
Oct 30 2010
parent Guillaume Chatelet <chatelet.guillaume gmail.com> writes:
Thx a lot Jonathan for all the good news.
I thought only the rpms were actually containing the binaries and the zip only
a source archive for people to build
locally. As you might know rpms are not really the Gentoo's philosophy so I
wanted to stick to Gentoo's portage. I
just gave a try to the zip and you're right, it's working like a breeze : )

I'm a newcomer to D and actually enjoying Andrei's book. Right now it feels to
me like the language I'm dreaming of
for years : terse, expressive, efficient. Let's see if it's true in the long
run.

Thanks also for pointing out the bug reporting strategy, I noticed the way my
messages appeared in the list was
quite different from the other and I was telling to myself I was surely out the
normal path.

Guillaume
Oct 30 2010