Should we declare _itch functions __GMP_NOTHROW __GMP_ATTRIBUTE_PURE ?

Marc Glisse marc.glisse at inria.fr
Sun Jan 5 17:33:51 UTC 2014


On Sun, 5 Jan 2014, bodrato at mail.dm.unipi.it wrote:

> Ciao,
>
> Il Dom, 5 Gennaio 2014 5:06 pm, Torbjorn Granlund ha scritto:
>> bodrato at mail.dm.unipi.it writes:
>>
>>  > Indeed.  I pushed a fix.
>>
>>   Any comment about marking them also with __GMP_NOTHROW ?
>>
>> Perhaps that too.  I suppose __GMP_ATTRIBUTE_PURE should really be the
>> stronger ATTRIBUTE_CONST, except that we don't yet have any name space
>> clean way of doing that for gmp.h.
>
> But we have it in gmp-impl.h, I pushed this change.
>
> Are there compilers that have the attribute pure and not the attribute const?
> In case, should we use pure as a fallback? With something like this patch?

>From the doc, it seems that gcc had attribute const in 2.5 and pure in 
2.9x, so I am not sure why we go through all this trouble for const 
(autoconf, etc), I would just define __GMP_ATTRIBUTE_CONST in gmp-h.in 
next to __GMP_ATTRIBUTE_PURE and use it also for the itch functions in 
that file.

-- 
Marc Glisse


More information about the gmp-devel mailing list