Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Server] Fix an include in OssCsi #1511

Merged
merged 1 commit into from
Sep 10, 2021
Merged

[Server] Fix an include in OssCsi #1511

merged 1 commit into from
Sep 10, 2021

Conversation

smithdh
Copy link
Contributor

@smithdh smithdh commented Sep 10, 2021

Compiling XrdOssCsiPages.hh was breaking builds on sl6, even when using when a compiler with c++14 support. This was reported by an lhc experiment. The cause was that in this build inttypes.h did not define macros such as PRIx64. On sl6, setting __STDC_FORMAT_MACROS before the include does cause it to define the macros; but the solution in this PR is to use the c++11 version of this header, cinttypes.

@adriansev
Copy link
Contributor

Hi @smithdh and thanks! :) while maybe out-side of your scope of work, maybe it would useful to convert all inttypes.h usage to cinttypes? @simonmichal what do you think?
Thanks a lot!

@xrootd-dev
Copy link

xrootd-dev commented Sep 10, 2021 via email

@adriansev
Copy link
Contributor

@abh3 so, beside of the sl6 error that we have (and this PR is fixing it ), it is not a good practice to use c headers in c++ code, and AFAIK there is always a recommendation to switch to usage of c++ includes (so we always use either stdint.h or cstdint is actually the problem that i'm talking about.).
regarding this present issue, the problem is that c header did not correctly worked on gcc 7.3.0 and the problem is fixed with c++ header. given the wide usage of inttypes.h in xrootd code i gave the suggestion for the wide fix (not just in this file, just use cinttypes everywhere).
Any other considerations, future developments, whole code refactoring and architecture decisions can be always done in future PRs i would say..

@abh3
Copy link
Member

abh3 commented Sep 10, 2021 via email

@abh3 abh3 merged commit ad54955 into xrootd:master Sep 10, 2021
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.

None yet

4 participants