[Piglit] [PATCH 2/3] util: Disable "overflow in floating-point constant arithmetic" in strtod_inf.
Jose Fonseca
jfonseca at vmware.com
Wed Dec 3 14:21:27 PST 2014
On 03/12/14 22:19, Emil Velikov wrote:
> On 03/12/14 15:37, Jose Fonseca wrote:
>> From: José Fonseca <jfonseca at vmware.com>
>>
>> Now that this is an inline function, the warning appears all over the
>> place.
>> ---
>> tests/util/piglit-util.h | 5 +++++
>> 1 file changed, 5 insertions(+)
>>
>> diff --git a/tests/util/piglit-util.h b/tests/util/piglit-util.h
>> index 90d57d3..099075a 100755
>> --- a/tests/util/piglit-util.h
>> +++ b/tests/util/piglit-util.h
>> @@ -187,6 +187,9 @@ strtod_inf(const char *nptr, char **endptr)
>> while (*nptr == ' ' || *nptr == '\t')
>> nptr++;
>>
>> +#pragma warning( push )
>> +#pragma warning( disable : 4056 ) // overflow in floating-point constant arithmetic
>> +#pragma warning( disable : 4756 ) // overflow in constant arithmetic
>>
> Haven't checked but I guess that those will trigger warnings with
> gcc/clang/others:
> warning: ignoring #pragma warning
>
> As -Wall pulls in -Wunknown-pragmas. The former being set in CMakeLists.txt
>
> Maybe wrap them in ifdef _MSC_VER or add -Wno-unknown-pragmas to the
> CMAKE_C{,XX}_FLAGS ?
>
It's already inside a `#if defined(_MSC_VER)` ... `#endif`.
Jose
More information about the Piglit
mailing list