Skip to content

Mac xdr workaround#4390

Open
roystgnr wants to merge 2 commits intolibMesh:develfrom
roystgnr:mac_xdr_workaround
Open

Mac xdr workaround#4390
roystgnr wants to merge 2 commits intolibMesh:develfrom
roystgnr:mac_xdr_workaround

Conversation

@roystgnr
Copy link
Member

@roystgnr roystgnr commented Feb 5, 2026

Refs #4387

Currently on some Mac builds we're seeing:

../src/utils/xdr_cxx.C:565:12: error: cast from 'int (*)(XDR *, int )' (aka 'int ()(__rpc_xdr *, int )') to 'xdrproc_t' (aka 'int ()(__rpc_xdr *, void *, unsigned int)') converts to incompatible function type [-Werror,-Wcast-function-type-mismatch]
565 | return (xdrproc_t)(xdr_int);

I'd think "Are the XDR procs of type xdrproc?" would be an "Is the Pope Catholic?" sort of question, but here we are.

Also, at least on my system while testing a fix for the above, I encountered the fact that my MacOSX SDK's rpc.h can define xdr_long as taking int* rather than long*, so I added a workaround for that case.

This is passing my initial tests; hopefully CI will catch anything I missed.

Refs libMesh#4387

Currently on some Mac builds we're seeing:

../src/utils/xdr_cxx.C:565:12: error: cast from 'int (*)(XDR *, int *)' (aka 'int (*)(__rpc_xdr *, int *)') to 'xdrproc_t' (aka 'int (*)(__rpc_xdr *, void *, unsigned int)') converts to incompatible function type [-Werror,-Wcast-function-type-mismatch]
  565 |     return (xdrproc_t)(xdr_int);

I'd think "Are the XDR procs of type xdrproc?" would be an "Is the Pope
Catholic?" sort of question, but here we are.
// builds when trying to pass XDR's own functions to xdrproc_t
// arguments - apparently because the xdr_foo functions now only take
// two arguments? We'll add some shims to convert them.
#ifdef __APPLE__
Copy link
Member

Choose a reason for hiding this comment

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

Does this workaround also apply to previous versions of MacOS where we never had this problem in the first place? In other words, is checking __APPLE__ sufficient here, or do you have to check for a specific version as well?

@moosebuild
Copy link

Job Coverage, step Generate coverage on 5bd031f wanted to post the following:

Coverage

09aedd #4390 5bd031
Total Total +/- New
Rate 65.31% 65.31% +0.00% 35.71%
Hits 77628 77632 +4 5
Misses 41234 41230 -4 9

Diff coverage report

Full coverage report

Warnings

  • New new line coverage rate 35.71% is less than the suggested 90.0%

This comment will be updated on new commits.

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