Subject: |
[Bug 1666924] Re: remove all uses of XXXSUPFUN typedefs |
From: |
Andrew Johnson via Core-talk <[email protected]> |
To: |
[email protected] |
Date: |
Thu, 16 May 2019 23:03:31 -0000 |
I don't know of any record types that provide an RSET::init() routine,
even the motor record has that routine set to NULL (the axis record is a
fork of the motor record). If there are no users, there should be
nothing to stop us from fixing the typed_rset declaration. I concur with
your argument list, iocInit.c::initRecSup() calls it like this:
if (prset->init) {
prset->init();
}
--
You received this bug notification because you are a member of EPICS
Core Developers, which is subscribed to EPICS Base.
Matching subscriptions: epics-core-list-subscription
https://bugs.launchpad.net/bugs/1666924
Title:
remove all uses of XXXSUPFUN typedefs
Status in EPICS Base:
Fix Released
Bug description:
The OO-like function tables defined in recSup.h, devSup.h, and
drvSup.h disable type checking by using the typedefs RECSUPFUN,
DEVSUPFUN, and DRVSUPFUN, respectively, which declare the methods as
having "any number and type of arguments". For instance, this is in
devSup.h:
typedef long (*DRVSUPFUN) (); /* ptr to driver support function*/
typedef struct drvet { /* driver entry table */
long number; /*number of support routines*/
DRVSUPFUN report; /*print report*/
DRVSUPFUN init; /*init support*/
}drvet;
Supports have to uses casts to XXXSUPFUN when they fill a xxxet
structure.
I think listing the well-known reasons why this is bad would be
redundant. As an illustration, see the bug recently uncovered by
Carsten Winkler (http://www.aps.anl.gov/epics/tech-
talk/2017/msg00347.php).
I propose to change the definition of these structs so that all the
methods get their proper type.
There remains the question how to handle the (implicit) subtype
polymorphism for things like dbCommon. I propose to handle this by
forcing support definitions to explicitly cast the argument (e.g.
dbCommon *precord) to the appropriate subtype; this adds one line of
code to each support function e.g.
long process(dbCommon *pdbCommon)
{
aoRecord *prec = (aoRecord *)pdbCommon;
...use prec from here onward...
}
To manage notifications about this bug go to:
https://bugs.launchpad.net/epics-base/+bug/1666924/+subscriptions
- Navigate by Date:
- Prev:
Build failed in Jenkins: epics-pva2pva-win64s #96 APS Jenkins via Core-talk
- Next:
Build failed in Jenkins: 3.15-pva2pva-win64s #206 APS Jenkins via Core-talk
- Index:
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
<2019>
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
[Bug 1666924] Re: remove all uses of XXXSUPFUN typedefs mdavidsaver via Core-talk
- Next:
Jenkins build is back to stable : epics-pva2pva-linux32 #113 APS Jenkins via Core-talk
- Index:
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
<2019>
2020
2021
2022
2023
2024
|