[GiNaC-devel] Wrong patch (Was: Fix unsigned character bugs in ginac-1.5.8)
Richard B. Kreckel
kreckel at ginac.de
Wed Apr 6 09:33:50 CEST 2011
Hi!
On 04/02/2011 02:06 PM, Alexei Sheplyakov wrote:
> On Sat, Apr 02, 2011 at 12:08:24PM +0200, Martin Guy wrote:
>
>> This patch fixes a bug on machines where char is unsigned by default, by
>> extending the type of clifford_max_label to include all 257 possible
>> return values.
>
> I'm sorry to confuse you, but your patch is wrong. It just breaks ABI for
> nothing good at all. In practice there's no need for gamma matrices with
> 128 representation labels (otherwise GiNaC would have problems on machines
> where char is *signed* by default). I guess we should fix the documentation
> (it claims that representation labels from 0 to 255 are supported, which
> is definitely wrong).
Alexei, does it really break the ABI? Whether we return an int here or a
char won't change library symbol names and since chars are returned as
ints, it won't change anything binary-wise.
There are cases where clifford_max_label returns -1, so this is indeed
broken. And this doesn't seem to have anything to do with having 255
different representation labels (which would be crazy, I agree.)
So, I don't see a problem with Martin's patch. Did I miss anything?
-richy.
--
Richard B. Kreckel
<http://www.ginac.de/~kreckel/>
More information about the GiNaC-devel
mailing list