1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 <2016> 2017 2018 2019 2020 2021 2022 2023 2024 2025 | Index | 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 <2016> 2017 2018 2019 2020 2021 2022 2023 2024 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: EPICS Base Release-Candidate Double Feature! |
From: | Matt Rippa <[email protected]> |
To: | Andrew Johnson <[email protected]> |
Cc: | Talk EPICS Tech <[email protected]> |
Date: | Thu, 17 Nov 2016 13:25:31 -1000 |
Hi Andrew,
Sorry, I didn't refer to this in my original reply, but I had also changed the first line from "#if defined(WIN32)" to "#if defined(_WIN32)" as "WIN32" is not defined by Visual Studio (it is by MinGW though in addition to _WIN32). So the 3.15 test program it was taken from builds with VS 2015 as it never actually tries to call _set_output_format() .
Regards,
Freddie
-----Original Message-----
From: Johnson, Andrew N. [mailto:[email protected]]
Sent: 12 November 2016 17:03
To: Akeroyd, Freddie (STFC,RAL,ISIS)
Cc: [email protected]
Subject: Re: EPICS Base Release-Candidate Double Feature!
Hi Freddie,
Thanks, I will commit that change on Monday. I copied that code including the conditional from one of the test programs in 3.15 src/ioc/db/test though, so I'm wondering how you didn't see a build failure with VS2015 there - could you investigate please?
Regards,
- Andrew
--
Sent from my iPad
> On Nov 12, 2016, at 8:06 AM, "[email protected]" <[email protected]> wrote:
>
> Hi Andrew,
>
> Your patch does indeed fix the formatting problem present in earlier versions of Visual Studio, but it appears that when Microsoft corrected this issue in Visual Studio 2015 they decided to remove the _set_output_format() function at the same time! So I just needed to adjust the test to:
>
> #if defined(_WIN32)
> #if (defined(_MINGW) && __MSVCRT_VERSION__ >= 0x0800) || \
> (defined(_MSC_VER) && _MSC_VER < 1900)
> _set_output_format(_TWO_DIGIT_EXPONENT);
> #endif
> #endif /* defined(_WIN32) */
>
> and then it works OK with both VS 2010 and 2015 for testPlan(163)
>
> Regards,
>
> Freddie
>
> -----Original Message-----
> From: Andrew Johnson [mailto:[email protected]]
> Sent: 11 November 2016 20:43
> To: Akeroyd, Freddie (STFC,RAL,ISIS); [email protected]
> Subject: Re: EPICS Base Release-Candidate Double Feature!
>
> Hi Freddie,
>
>> On 11/10/2016 05:52 PM, [email protected] wrote:
>> epicsStdioTest.c plans 166 tests on Windows but 163 otherwise, if I
>> build using Visual Studio 2010 instead 166 tests passed OK. On
>> further investigation it seems the issue occurs within
>> testEpicsSnprintf() and is due to Microsoft changing (fixing) the
>> formatting of "%8.2e" by sprint():
>>
>> In Visual Studio 2010 this generates 1.23e+004
>> In Visual Studio 2015 this generates 1.23e+04
>
> Thanks for the report. Does this patch make the test pass on both compilers?
>
> === modified file 'src/libCom/test/epicsStdioTest.c'
> --- src/libCom/test/epicsStdioTest.c 2012-02-03 22:12:06 +0000
> +++ src/libCom/test/epicsStdioTest.c 2016-11-11 20:40:36 +0000
> @@ -39,6 +39,11 @@
> int size;
> int rtn, rlen;
>
> +#if defined(WIN32) && \
> + (!defined(_MINGW) || __MSVCRT_VERSION__ >= 0x0800)
> + _set_output_format(_TWO_DIGIT_EXPONENT);
> +#endif
> +
> sprintf(exbuffer, format, ivalue, fvalue, svalue);
> rlen = strlen(expected)+1;
>
> @@ -122,11 +127,7 @@
>
> MAIN(epicsStdioTest)
> {
> -#ifdef _WIN32
> - testPlan(166);
> -#else
> testPlan(163);
> -#endif
> testEpicsSnprintf();
> testStdoutRedir("report");
> return testDone();
>
>
> - Andrew
>
>
> --
> Arguing for surveillance because you have nothing to hide is no
> different than making the claim, "I don't care about freedom of speech
> because I have nothing to say." -- Edward Snowdon