EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
<== 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
I'm testing Gemini's genSubRecord.c against R3.15.5-rc1. Looks like our RSET implementation is now obsolete as of R3.15.3 (See: http://www.aps.anl.gov/epics/base/R3-15/3-docs/RELEASE_NOTES.html   RSET::get_value()).

Is there a porting guide to Record support for R3.15 ?

Thank you,
Matt
---------------------
Build Error:

make[3]: Entering directory `/home/mrippa/work/R3.15.5/support/geminiRec/geminiRecApp/src/O.linux-x86_64'
/usr/bin/gcc  -D_GNU_SOURCE -D_DEFAULT_SOURCE            -D_X86_64_  -DUNIX  -Dlinux     -O3 -g   -Wall      -mtune=generic     -m64 -fPIC -I. -I../O.Common -I. -I. -I.. -I../../../include/compiler/gcc -I../../../include/os/Linux -I../../../include -I/gem_sw/epics/R3.15.5-rc1/base/include/compiler/gcc -I/gem_sw/epics/R3.15.5-rc1/base/include/os/Linux -I/gem_sw/epics/R3.15.5-rc1/base/include        -c ../genSubRecord.c
../genSubRecord.c:607: warning: ‘struct valueDes’ declared inside parameter list
../genSubRecord.c:607: warning: its scope is only this definition or declaration, which is probably not what you want
../genSubRecord.c: In function ‘get_value’:
../genSubRecord.c:612: error: dereferencing pointer to incomplete type
../genSubRecord.c:613: error: dereferencing pointer to incomplete type
../genSubRecord.c:614: error: dereferencing pointer to incomplete type
../genSubRecord.c: In function ‘findField’:
../genSubRecord.c:1076: error: ‘genSubRecord’ has no member named ‘not’
../genSubRecord.c:1080: error: ‘genSubRecord’ has no member named ‘not’
../genSubRecord.c:1082: error: ‘genSubRecord’ has no member named ‘not’
make[3]: *** [genSubRecord.o] Error 1
make[3]: Leaving directory `/home/mrippa/work/R3.15.5/support/geminiRec/geminiRecApp/src/O.linux-x86_64'

Relevant legacy code:
genSubRecord.c
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

#include <alarm.h>
#include <dbDefs.h>
#include <dbEvent.h>
#include <dbAccess.h>
#include <dbFldTypes.h>
#include <errMdef.h>
#include <recSup.h>
#include <devSup.h>
#include <special.h>
#include <registryFunction.h>
#include <epicsExport.h>
#include <recGbl.h>

...
rset genSubRSET={
RSETNUMBER,
report,
initialize,
init_record,
process,
special,
get_value,
cvt_dbaddr,
get_array_info,
put_array_info,
get_units,
get_precision,
get_enum_str,
get_enum_strs,
put_enum_str,
get_graphic_double,
get_control_double,
get_alarm_double };
epicsExportAddress(rset,genSubRSET);
...

static long get_value( genSubRecord *pgsub, struct valueDes *pvdes )
{
#if DEBUG
    printf("Calling get_value...\n");
#endif
    pvdes->no_elements = 1;
    pvdes->pvalue      = (void *)(&pgsub->val);
    pvdes->field_type  = DBF_LONG;
    return(0);
}



On Sun, Nov 13, 2016 at 8:38 AM, <[email protected]> wrote:
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



Replies:
Re: EPICS Base Release-Candidate Double Feature! Andrew Johnson
References:
EPICS Base Release-Candidate Double Feature! Andrew Johnson
RE: EPICS Base Release-Candidate Double Feature! freddie.akeroyd
Re: EPICS Base Release-Candidate Double Feature! Andrew Johnson
RE: EPICS Base Release-Candidate Double Feature! freddie.akeroyd
Re: EPICS Base Release-Candidate Double Feature! Johnson, Andrew N.
RE: EPICS Base Release-Candidate Double Feature! freddie.akeroyd

Navigate by Date:
Prev: Re: OS X edm/medm openmotif woes J. Lewis Muir
Next: Re: EPICS Base Release-Candidate Double Feature! Andrew Johnson
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: EPICS Base Release-Candidate Double Feature! freddie.akeroyd
Next: Re: EPICS Base Release-Candidate Double Feature! Andrew Johnson
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 17 Nov 2016 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·