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

Replace READONLY with const #30

Merged
merged 1 commit into from
Dec 4, 2023

Conversation

jlmuir
Copy link
Contributor

@jlmuir jlmuir commented Nov 30, 2023

synApps R6-2-1 (the latest release as of 2023-11-30) includes sscan R2-11-4 (not the latest release as of 2023-11-30), which fails to build against EPICS Base 7.0.7 due to sscan's use of the READONLY macro:

../saveData_writeXDR.c:1841:2: error: use of undeclared identifier 'READONLY'
        READONLY DBR_VAL * pval = eha.dbr;
        ^

Andrew Johnson suggests in

https://epics.anl.gov/tech-talk/2023/msg01849.php

that the READONLY macro was likely being defined as a side effect with earlier versions of EPICS Base because most EPICS Base header files used to include shareLib.h, which defines READONLY. In EPICS Base now, though, Andrew says that the shareLib.h header file is no longer being included by most of the EPICS Base header files, and so it's likely that this is why sscan R2-11-4 no longer builds.

Andrew recommends replacing READONLY with const now that all the compilers supported by EPICS Base support the const keyword, so do just that.

Lastly, this particular build failure was likely fixed in commit

420274c

which adds a shareLib.h include to saveData_writeXDR.c. However, it didn't add an include to saveData.c, so that file is likely still ending up with READONLY defined as a side effect. Given this and Andrew's comments, it's better to replace READONLY with const.

synApps R6-2-1 (the latest release as of 2023-11-30) includes sscan
R2-11-4 (not the latest release as of 2023-11-30), which fails to build
against EPICS Base 7.0.7 due to sscan's use of the READONLY macro:

----
../saveData_writeXDR.c:1841:2: error: use of undeclared identifier 'READONLY'
        READONLY DBR_VAL * pval = eha.dbr;
        ^
----

Andrew Johnson suggests in

  https://epics.anl.gov/tech-talk/2023/msg01849.php

that the READONLY macro was likely being defined as a side effect with
earlier versions of EPICS Base because most EPICS Base header files used
to include shareLib.h, which defines READONLY.  In EPICS Base now,
though, Andrew says that the shareLib.h header file is no longer being
included by most of the EPICS Base header files, and so it's likely that
this is why sscan R2-11-4 no longer builds.

Andrew recommends replacing READONLY with const now that all the
compilers supported by EPICS Base support the const keyword, so do just
that.

Lastly, this particular build failure was likely fixed in commit

  420274c

which adds a shareLib.h include to saveData_writeXDR.c.  However, it
didn't add an include to saveData.c, so that file is likely still ending
up with READONLY defined as a side effect.  Given this and Andrew's
comments, it's better to replace READONLY with const.
@keenanlang keenanlang merged commit 1409a89 into epics-modules:master Dec 4, 2023
4 of 5 checks passed
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

Successfully merging this pull request may close these issues.

2 participants