void* pointers get corrupted: D bug or misunderstanding?
    Federico Santamorena 
    federico at santamorena.me
       
    Mon Jul 29 15:26:34 UTC 2019
    
    
  
On Monday, 29 July 2019 at 13:27:51 UTC, Kagamin wrote:
> On Monday, 29 July 2019 at 12:42:37 UTC, Federico Santamorena 
> wrote:
>> I thought you couldn't use D things like "ref" in extern(C)
>
> It's not recommended for proper C bindings, as interoperability 
> can be tricky, so they are kept close to original C source. 
> Also to port C code and examples invocation should be as close 
> to C code as possible. I would say your use of UFCS with gtk 
> functions is probably not a good idea, it's difficult to 
> recognize them as gtk functions this way, I had a suspicion 
> something smart is going on there.
I see.
I still actually want to push the idea that a void* pointer to a 
void* pointer should be a warning emitted by the compiler.
Or even better a new flag emitting warnings for fishy void* 
pointers manipulation.
Ideas about this?
    
    
More information about the Digitalmars-d
mailing list