users-prolog
[Top][All Lists]
Advanced

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

Re: Bug in gprolog.h?


From: Roberto Bagnara
Subject: Re: Bug in gprolog.h?
Date: Fri, 05 Jul 2013 15:14:11 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050929 Thunderbird/1.0.7 Fedora/1.0.7-1.1.fc4 Mnenhy/0.7.3.0

On 07/04/13 13:22, Daniel Diaz wrote:
> Thank you for this bug report. Fixed in the git. Here is the main diff:
> 
> diff --git a/src/EnginePl/pl_config.c b/src/EnginePl/pl_config.c
> index def0080..8f9c342 100644
> --- a/src/EnginePl/pl_config.c
> +++ b/src/EnginePl/pl_config.c
> @@ -917,7 +917,7 @@ Generate_Tags(FILE *f, FILE *g)
> 
>    tag_mask = Mk_Tag_Mask((1 << tag_size) - 1);
> 
> -  max_integer = ((PlLong) 1 << (WORD_SIZE - tag_size - 1)) - 1;
> +  max_integer = (1 << (WORD_SIZE - tag_size - 1)) - 1;
>    min_integer = -max_integer - 1;
> 
>    fprintf(fg_c, "#define PL_MIN_INTEGER\t\t%" PL_FMT_d "\n",  min_integer);

It works: thanks!

> Le 03/07/2013 18:09, Roberto Bagnara a écrit :
>> The header file gprolog.h installed by GNU Prolog 1.4.4
>> contains the following (unconditional) definitions:
>>
>> #define PL_MIN_INTEGER        -268435456
>> #define PL_MAX_INTEGER        268435455
>>
>> These are inconsistent with the real limits:
>>
>> $ gprolog
>> GNU Prolog 1.4.4 (64 bits)
>> Compiled Jul  3 2013, 18:05:18 with gcc
>> By Daniel Diaz
>> Copyright (C) 1999-2013 Daniel Diaz
>> | ?- current_prolog_flag(min_integer, M).
>>
>> M = -1152921504606846976
>>
>> yes
>> | ?- current_prolog_flag(max_integer, M).
>>
>> M = 1152921504606846975
>>
>> yes
>> | ?-
>>
>> Kind regards,
>>
>>      Roberto
>>
> 
> 


-- 
     Prof. Roberto Bagnara

Applied Formal Methods Laboratory - University of Parma, Italy
mailto:address@hidden
                              BUGSENG srl - http://bugseng.com
                              mailto:address@hidden



reply via email to

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