Skip to content

Conversation

@schwicke
Copy link
Contributor

@schwicke schwicke commented Feb 3, 2025

The current header files of XrdPosix do not properly work when used in a C context. Compiling this reproducer:

#include <stdio.h>
#include <XrdPosix/XrdPosix.hh>
int main(){
}

With clang this fails because the code tries to include cstdio instead of stdio.h in C context. After fixing this, it works with clang but not with gcc. There are 2 more issues:

  • with gcc 11 and newer the code fails to compile when dirent.h is included. This can be fixed by re-arranging the code properly
  • Some of the types defined in XrdPosixExtern.hh conflict with the system defaults, e.g. long long should be __off64_t or int functions are actually size_t. Newer compiler versions complain about this. The patch adapts the function definitions accordingly.

@amadio amadio requested a review from abh3 February 4, 2025 08:53
@amadio amadio self-assigned this Feb 4, 2025
@amadio
Copy link
Member

amadio commented Feb 5, 2025

There are no ABI compatibility problems with these changes. Merging.

@amadio amadio merged commit b7cc4cd into xrootd:master Feb 5, 2025
9 checks passed
@amadio
Copy link
Member

amadio commented Feb 5, 2025

For the record, this was needed in order to add support for XRootD into cernlib:
https://gitlab.cern.ch/DPHEP/cernlib/cernlib/-/merge_requests/321

@amadio amadio added this to the 5.8.0 milestone Feb 19, 2025
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