Skip to content

Conversation

@JJL772
Copy link

@JJL772 JJL772 commented Oct 14, 2025

Incompatible pointers are errors by default in C23, and those old style implicit function declarations were removed.

Incompatible pointers and implicit function declaration are now errors by default in C23
@simon-ess
Copy link

See "linked" PRs epics-modules/asyn#222 and epics-modules/iocStats#67

Copy link
Member

@anjohnson anjohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_DSET

The 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*);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@JJL772
Copy link
Author

JJL772 commented Oct 29, 2025

Thanks for the feedback @anjohnson. I think my only concern with USE_TYPED_DSET is compatibility with older versions of base that don't fully support typed dsets. The last I checked, base 7.0.4 is the first version of have complete typed dset support, and at SLAC we're still on base 7.0.3.1 (pending upgrade to 7.0.9+). If compatibility with older versions of base is desired, the ugly casts would have to stay along with the typed dsets, albeit under an ifdef.

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.

3 participants