Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error compiling against EPICS 7.0.8: incomplete definition of type 'struct evSubscrip' #8

Open
jlmuir opened this issue Dec 19, 2023 · 1 comment

Comments

@jlmuir
Copy link

jlmuir commented Dec 19, 2023

When compiling caputRecorder 1-7-5 against EPICS 7.0.8, I get the following error:

../subMLIS.c:57:40: error: incomplete definition of type 'struct evSubscrip'

I found Michael Davidsaver's (@mdavidsaver) EPICS commit 3d25756, which wraps the struct evSubscrip definition in dbChannel.h in an #ifdef EPICS_PRIVATE_API. When I compile, EPICS_PRIVATE_API is not defined, so there's no struct evSubscrip definition, and I think that's why I'm getting this error.

FYI, I also found issue #4, which involved a similar problem in the same source code location.

Here's the end of an example terminal session:

cc              -DUNIX  -Ddarwin      -O3 -g   -Wall -Werror-implicit-function-declaration     -DUSE_TYPED_RSET   -arch arm64    -fno-common  -fPIC -I. -I../O.Common -I. -I. -I.. -I../../../include/compiler/clang -I../../../include/os/Darwin -I../../../include    -I/tmp/48/opt/epics-7.0.8/include/compiler/clang -I/tmp/48/opt/epics-7.0.8/include/os/Darwin -I/tmp/48/opt/epics-7.0.8/include        -c ../subMLIS.c
../subMLIS.c:57:40: error: incomplete definition of type 'struct evSubscrip'
                pevent = (evSub *)ellNext(&pevent->node);
                                           ~~~~~~^
/tmp/48/opt/epics-7.0.8/include/ellLib.h:100:30: note: expanded from macro 'ellNext'
#define ellNext(PNODE)     ((PNODE)->next)
                             ^~~~~
/tmp/48/opt/epics-7.0.8/include/dbEvent.h:33:8: note: forward declaration of 'struct evSubscrip'
struct evSubscrip;
       ^
1 error generated.
make[4]: *** [subMLIS.o] Error 1
make[3]: *** [install.darwin-aarch64] Error 2
make[2]: *** [src.install] Error 2
make[1]: *** [caputRecorderApp.install] Error 2
make: *** [/tmp/48/opt/synapps-6.2.1/caputRecorder-R1-7-5.install] Error 2

Platform:

  • Apple Silicon (EPICS_HOST_ARCH=darwin-aarch64)
  • macOS Sonoma 14.1.1
  • EPICS 7.0.8
  • caputRecorder 1-7-5
@mdavidsaver
Copy link

I had a look at SubMLIS().

Firstly, Traversing the MLIS linked list without holding the MLOK mutex is racy.

Secondly, The < 3.15 compatibility code makes me think the evSubscrip definition is not actually needed. The ELLNODE definition should be sufficient to traverse a list.

Thirdly, this code appears to be trying to detect when the list of dbEvent subscribers to a record changes. Although only the first 5 subscribers. I don't understand why this is relevant. Each record's subscribers list tracks interest in any field of that record, not just VAL. This list is also shared by all internal subscribers (eg. local CA, RSRV, QSRV, ...)

Is SubMLIS() being used as a proxy for some other information?

keenanlang added a commit that referenced this issue Jan 1, 2024
Until this file can be refactored, use a different name for the structure. Workaround due to shifts in definitions of evSubscrip in base-3.15, and then base-7.0.5, and again in base-7.0.8

ref #8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants