bug-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-glpk] minisat: copying 32 bit integer to 64 bit pointer


From: Chris Matrakidis
Subject: Re: [Bug-glpk] minisat: copying 32 bit integer to 64 bit pointer
Date: Thu, 19 Nov 2015 12:12:40 +0200

Hello Heinrich,
 
> #if 1 /* by mao; meaningless non-portable check */
If the check is necessary, the comment should be removed.

And of cause Andrew was right. The code (probably based on MiniSat-C
v1.14.1) is non-portable.
 
This is why I decided to leave the comment - only the "meaningless" part is arguable.

From a quick look, the C++ version of minisat 1.14 seems to use the same trick.
 
The easiest way to fix the code would be to use

struct storage {
  char is_pointer;
  union {
    void *pointer;
    int  lit;
  };
};

I thought of using something like that, however I wasn't confident of doing the changes without a better understanding of the code, so I opted for the minimal patch. Did you try it on 64bit Windows? I expect there will be some warning for 64 to 32 bit conversions.

Best Regards,

Chris Matrakidis

reply via email to

[Prev in Thread] Current Thread [Next in Thread]