atilaneves / dpp

Directly include C headers in D source code
Boost Software License 1.0
227 stars 31 forks source link

1 test fails #310

Closed lulcat closed 2 years ago

lulcat commented 2 years ago

Hi, I have a single test failing and it seems relevant to dstep (in fact, I wonder a bit how/what is the best way to use this tool with dstep?)

complimentary, exclusive?

Anyway, the error is in :

tests/it/c/dstep/issues.d:71 - 

Could not execute dmd -m64 -o- -c app.d:

app.d(92): Error: static assert: __traits(compiles, inf.headers[63].value) is false

It LOOKS ok to me, and should be ok but it isn't.

I don't really know how to add code and stuff to this so I apologise on beforehand for possibly poor markup.

app.d:

53: extern(C) 54: { 55:
56: struct info 57: { 58:
59: c_long remote_ip; 60:
61: int remote_port; 62:
63: int is_ssl; 64:
65: void user_data; 66:
67: struct mg_header 68: { 69:
70: const(char)
name; 71:
72: const(char)* value; 73: } 74:
75: info.mg_header[64] headers; 76: } 77: } 78:
79:
80: void main() { 81:
82: info inf; 83:
84: inf.remote_ip = 42L; 85: inf.remote_port = 42; 86: inf.is_ssl = 33; 87: inf.user_data = null; 88:
89: inf.headers[63].name = "name".ptr; 90: inf.headers[63].value = "value".ptr; 91:
92: static assert( traits(compiles, inf.headers[63].value)); 93: static assert(!traits(compiles, inf.headers[64].value)); 94:
95: }

And it's test 10, I suppose int he above mentioned file.

Not sure how to further verify what is going wrong (as I just downloaded dpp now and not even sure how to use it :)).

atilaneves commented 2 years ago

complimentary, exclusive?

Exclusive.

Anyway, the error is in :

I can't reproduce this.

lulcat commented 2 years ago

Hmmm. Ok. So then it must be something in my system? I think the system used was/is pseudo-outdated so would have to bisect or go looking but personally, I didn't mind too much, just thought I'd mention it since it was only one. I made a not of it and if it happens or something relevant comes up I can give you feedback. Otherwise, thanks. (for software and reply etc :))