[vlc-devel] [PATCH] configure: fix compiler warning when using --enable-debug with --disable-optimizations
Rémi Denis-Courmont
remi at remlab.net
Mon Mar 7 18:58:52 CET 2016
Le 2016-03-07 12:21, Steve Lhomme a écrit :
> On Mon, Feb 29, 2016 at 6:42 PM, Rémi Denis-Courmont
> <remi at remlab.net> wrote:
>> Le 2016-02-29 12:51, Steve Lhomme a écrit :
>>>
>>> On Fri, Feb 26, 2016 at 7:19 PM, Rémi Denis-Courmont
>>> <remi at remlab.net>
>>> wrote:
>>>>
>>>> Le 2016-02-26 10:29, Steve Lhomme a écrit :
>>>>>
>>>>>
>>>>> ---
>>>>> configure.ac | 2 +-
>>>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/configure.ac b/configure.ac
>>>>> index cd7ccbb..0624952 100644
>>>>> --- a/configure.ac
>>>>> +++ b/configure.ac
>>>>> @@ -1016,7 +1016,7 @@ AS_IF([test "${enable_optimizations}" !=
>>>>> "no"], [
>>>>> ])
>>>>> AS_IF([test "${ac_cv_c_fast_math}" = "no"],
>>>>> [VLC_RESTORE_FLAGS])
>>>>> AH_BOTTOM([
>>>>> -#ifndef __FAST_MATH__
>>>>> +#if !defined(__FAST_MATH__) && defined(NDEBUG)
>>>>> # ifndef _MSC_VER
>>>>> # pragma STDC FENV_ACCESS OFF
>>>>> # pragma STDC FP_CONTRACT ON
>>>>
>>>>
>>>>
>>>> Why?
>>>
>>>
>>> To avoid this kind of warning on every line (gcc 5.3.0 on mingw):
>>
>>
>> I fail to see the link with the patch.
>
> --disable-optimizations does not check if the compiler supports
> -ffast-math and so __FAST_MATH__ is not defined
>
> But the code in AH_BOTTOM is added to config.h (via config.h.in) no
> matter what. It is processed even if you disabled optimizations. So
> even if you use gcc, --fast-math is not set and we fall into this
> code.
> It seems gcc (4.9.3 and 5.3.0 on mingw) don't define the pragmas.
>
> --enable-debug defines NDEBUG and would at least avoid this warning.
> Otherwise we can disable these pragmas (and the MSVC ones) for GCC.
I still fail to see the link.
Besides, those are pragrams are required by ISO, and will be ignored on
broken compilers, so I fail to see a problem.
--
Rémi Denis-Courmont
http://www.remlab.net/
More information about the vlc-devel
mailing list