-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
C file should not include <cinttypes>, it is a C++ header. #5499
Conversation
Background: -#include <inttypes.h>
+#include <cinttypes> and accidentally changed a C file. The patch also removed As a consequence, MyRocks/MariaDB build fails on PPC now: https://jira.mariadb.org/browse/MDEV-19830 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@miasantreble has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Do we need the |
@riversand963 if it compiles, then we don't need it. |
@spetrunia if this file doesn't use format macros then maybe we can simply remove the include? |
According to people's experience with different compilers, e.g. https://stackoverflow.com/questions/14535556/why-doesnt-priu64-work-in-this-code, if |
@riversand963 I wonder whether __STDC_FORMAT_MACROS is a C++ thing or also is also applied to C. If it is a C++ thing, then we should not have it at all. The macro has name STD on it, so I suspect that it is a C++ thing. |
@siying , SG. Should not be necessary for C. |
Actually, seems like yes. I don't have access to a power8 machine, but examining the file manually, it looks like the EDIT: Wait, Should this be done in the scope of this PR or the current variant is fine too? |
I'd prefer removing unnecessary include directives |
Include <stdint.h> instead.
41de153
to
2895706
Compare
@miasantreble, changed the patch to include |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@miasantreble has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
@miasantreble merged this pull request in e731f44. |
…5499) Summary: Include <inttypes.h> instead. Pull Request resolved: facebook#5499 Differential Revision: D15966937 Pulled By: miasantreble fbshipit-source-id: 2156c4329b91d26d447de94f1231264d52786350
Include <inttypes.h> instead.