Fix numerous build errors when building with -std=c23#34
Fix numerous build errors when building with -std=c23#34JJL772 wants to merge 1 commit intoepics-modules:masterfrom
Conversation
Incompatible pointers and implicit function declaration are now errors by default in C23
|
See "linked" PRs epics-modules/asyn#222 and epics-modules/iocStats#67 |
anjohnson
left a comment
There was a problem hiding this comment.
In Base we converted all of the record types to publish their own typed DSET definitions in their generated Record.h file, with a macro HAS_XXdset to allow device support code to use that when it can. I want to encourage out-of-tree record types to adopt the same approach, along with similar typed RSET changes that this PR doesn't completely implement. The Makefile would also need this once they're all done:
USR_CPPFLAGS += -DUSE_TYPED_RSET -DUSE_TYPED_DSETThe typed_dset documentation gives an overview; unfortunately the recSup.h header hasn't been annotated yet so we don't have the same level of documentation for that, but there are many examples in the Base *Record.c and *Record.dbd.pod files (and in the generated *Record.h header, e.g. here).
| volatile int aCalcoutRecordDebug = 0; | ||
| epicsExportAddress(int, aCalcoutRecordDebug); | ||
|
|
||
| typedef long(*typed_devsupfun_t)(void*); |
There was a problem hiding this comment.
This change isn't the best solution for converting dset functions. I guess it works for these Record.c files where it generates the least number of code changes, but there could be some record types where it doesn't since the common DSET report(), init() and get_ioint_info() methods have different parameters. These records are also still using the old approach to DSET definition.
|
Thanks for the feedback @anjohnson. I think my only concern with |
Incompatible pointers are errors by default in C23, and those old style implicit function declarations were removed.