strange bug(?) with attribute inference, need help from volunteers

ketmar via Digitalmars-d digitalmars-d at puremagic.com
Fri Dec 19 11:29:19 PST 2014


Hello.

i just tried to compile cbor.d (see announce NG) and found this issue:

# dmd z00.d cbor.d

(z00.d is just a copypasted sample from README.md)

z00.o: In function 'pure nothrow @nogc @safe void cbor.putChecked!(ubyte[], ubyte).putChecked(ref ubyte[], const(ubyte))':
cbor.d:(.text._D4cbor21__T10putCheckedTAhThZ10putCheckedFNaNbNiNfKAhxhZv+0xa): undefined reference to 'pure nothrow @nogc @safe void std.range.primitives.put!(ubyte[], const(ubyte)).put(ref ubyte[], const(ubyte))'
z00.o: In function `_D4cbor22__T10putCheckedTAhTAhZ10putCheckedFNaNbNiNfKAhxAhZv':
cbor.d:(.text._D4cbor22__T10putCheckedTAhTAhZ10putCheckedFNaNbNiNfKAhxAhZv+0xd): undefined reference to 'pure nothrow @nogc @safe void std.range.primitives.put!(ubyte[], const(ubyte)[]).put(ref ubyte[], const(ubyte)[])'
z00.o: In function `_D4cbor22__T10putCheckedTAhTAhZ10putCheckedFNaNbNiNfKAhKxAhZv':
cbor.d:(.text._D4cbor22__T10putCheckedTAhTAhZ10putCheckedFNaNbNiNfKAhKxAhZv+0xf): undefined reference to 'pure nothrow @nogc @safe void std.range.primitives.put!(ubyte[], const(ubyte)[]).put(ref ubyte[], const(ubyte)[])'

sorry for the linenoise, but i think it is decipherable. i demangled
names for clarity.

seems that dmd somehow decides that `cbor.putChecked` is pure, and
couldn't find pure `put` for ranges (which is obvious; what use of pure
`put` can be? ;-).

but if i do this:

# dmd -c cbor.d
# dmd z00.d cbor.o

everything is fine and i got working `z00` binary.

i tried to dustmite that, but got complete garbage (as dustmite loves
to produce ;-). seems that this is a bug in attributes inference, but i
unable to minify it to something sane. maybe somebody brave enough can
write a sane sample which triggers this bug?


system: dmd from git head without any custom patches, GNU/Linux, x86.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20141219/463b4c65/attachment-0001.sig>


More information about the Digitalmars-d mailing list