Skip to content

Fix compilation errors on newer gcc (e.g. gcc 16) - #13

Open
nmarks99 wants to merge 1 commit into
epics-modules:masterfrom
nmarks99:master
Open

nmarks99 wants to merge 1 commit into
epics-modules:masterfrom
nmarks99:master

Conversation

@nmarks99

Copy link
Copy Markdown

Newer versions of gcc (I tested with gcc 16.2.1) treat conflicting types for function declarations as errors, so aliveRecord.c won't compile as is.

../aliveRecord.c:763:13: error: conflicting types for ‘init_record’; have ‘long int(void *, int)’
  763 | static long init_record(void *precord, int pass)
      |             ^~~~~~~~~~~
../aliveRecord.c:75:13: note: previous declaration of ‘init_record’ with type ‘long int(void)’
   75 | static long init_record();
      |             ^~~~~~~~~~~
../aliveRecord.c:915:13: error: conflicting types for ‘process’; have ‘long int(aliveRecord *)’
  915 | static long process(aliveRecord *prec)
      |             ^~~~~~~
../aliveRecord.c:76:13: note: previous declaration of ‘process’ with type ‘long int(void)’
   76 | static long process();
      |             ^~~~~~~
../aliveRecord.c:929:13: error: conflicting types for ‘special’; have ‘long int(DBADDR *, int)’ {aka ‘long int(dbAddr *, int)’}
  929 | static long special(DBADDR *paddr, int after)

This PR fixes it by filling in the correct function arguments in the forward declarations to init_record, process, and special. I also needed to explicity cast them to DEVSUPFUN in the rset aliveRSET = {... definition.

@nmarks99

nmarks99 commented Oct 14, 2026 •

Copy link
Copy Markdown
Author

Fails on base 3.15. I guess it doesn't have DEVSUPFUN? Looks like the same problem as mentioned here: epics-modules/asyn#222. Maybe instead should be using typed dset? See epics-modules/calc#34.

This branch has not been deployed

No deployments
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.

1 participant