[Mesa-dev] [PATCH] glsl: Fix isinf() for non-C99-compliant compilers.

Ian Romanick idr at freedesktop.org
Thu Jan 19 09:21:57 PST 2012


On 01/18/2012 01:09 PM, Paul Berry wrote:
> On 18 January 2012 12:43, Jose Fonseca <jfonseca at vmware.com
> <mailto:jfonseca at vmware.com>> wrote:
>
>     Looks good to me. Thanks
>
>     Should there be a case for -INF while we are at it?
>
>
> I think you can make arguments both for and against.  On the one hand,
> C99 requires strtod to recognize "INF", "+INF", "-INF", "INFINITY",
> "+INFINITY", "-INFINITY", and capitalization variations of those, in
> addition to a bunch of representations of NaN, so for maximum
> portability you might argue we should make our s-expression parser
> handle all of those even on non-C99 systems.  On the other hand,
> s-expression parsing is only used for builtin functions, and at the
> moment builtin functions only use "+INF", so any code we write to
> support other forms won't actually be exercised.  Personally, I favor

If this support were added before having built-ins that exercise it, we 
should add a unit test to verify the functionality.

> just doing "+INF" on the grounds that it is the smallest fix that meets
> our present needs, and that adding anything else would require extra
> testing effort to validate.  Keeping the fix as small as possible seems
> especially prudent considering that this fix is a candidate for the 8.0
> branch.

I agree.

> Paul


More information about the mesa-dev mailing list