forked from facebookarchive/skybison
-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Fix timespec/timeval warning when compiling C extension modules #525
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
On some compilers, the warnings below get generated. I think it's something to do with not defining `_POSIX_C_SOURCE` when we include `time.h` but that didn't work--so it might be a project-level setting that we need to tweak. In the meantime, forward declare the structs in `cpython-types.h`. ``` In file included from /home/max/Documents/code/skybison/build-relwithdebinfo/include/skybison3.8/cpython-data.h:5, from /home/max/Documents/code/skybison/build-relwithdebinfo/include/skybison3.8/Python.h:15, from signature.c:1: /home/max/Documents/code/skybison/build-relwithdebinfo/include/skybison3.8/cpython-func.h:1311:58: warning: ‘struct timespec’ declared inside parameter list will not be visible outside of this definition or declaration 1311 | PyAPI_FUNC_DECL(int _PyTime_AsTimespec(_PyTime_t, struct timespec*)); | ^~~~~~~~ /home/max/Documents/code/skybison/build-relwithdebinfo/include/skybison3.8/cpython-func.h:21:70: note: in definition of macro ‘PyAPI_FUNC_DECL’ 21 | #define PyAPI_FUNC_DECL(DECL) __attribute__((visibility("default"))) DECL | ^~~~ /home/max/Documents/code/skybison/build-relwithdebinfo/include/skybison3.8/cpython-func.h:1312:57: warning: ‘struct timeval’ declared inside parameter list will not be visible outside of this definition or declaration 1312 | PyAPI_FUNC_DECL(int _PyTime_AsTimeval(_PyTime_t, struct timeval*, | ^~~~~~~ /home/max/Documents/code/skybison/build-relwithdebinfo/include/skybison3.8/cpython-func.h:21:70: note: in definition of macro ‘PyAPI_FUNC_DECL’ 21 | #define PyAPI_FUNC_DECL(DECL) __attribute__((visibility("default"))) DECL | ^~~~ /home/max/Documents/code/skybison/build-relwithdebinfo/include/skybison3.8/cpython-func.h:1316:65: warning: ‘struct timeval’ declared inside parameter list will not be visible outside of this definition or declaration 1316 | PyAPI_FUNC_DECL(int _PyTime_AsTimeval_noraise(_PyTime_t, struct timeval*, | ^~~~~~~ /home/max/Documents/code/skybison/build-relwithdebinfo/include/skybison3.8/cpython-func.h:21:70: note: in definition of macro ‘PyAPI_FUNC_DECL’ 21 | #define PyAPI_FUNC_DECL(DECL) __attribute__((visibility("default"))) DECL | ^~~~ /home/max/Documents/code/skybison/build-relwithdebinfo/include/skybison3.8/cpython-func.h:1325:64: warning: ‘struct timespec’ declared inside parameter list will not be visible outside of this definition or declaration 1325 | PyAPI_FUNC_DECL(int _PyTime_FromTimespec(_PyTime_t* tp, struct timespec* ts)); | ^~~~~~~~ /home/max/Documents/code/skybison/build-relwithdebinfo/include/skybison3.8/cpython-func.h:21:70: note: in definition of macro ‘PyAPI_FUNC_DECL’ 21 | #define PyAPI_FUNC_DECL(DECL) __attribute__((visibility("default"))) DECL | ^~~~ /home/max/Documents/code/skybison/build-relwithdebinfo/include/skybison3.8/cpython-func.h:1326:63: warning: ‘struct timeval’ declared inside parameter list will not be visible outside of this definition or declaration 1326 | PyAPI_FUNC_DECL(int _PyTime_FromTimeval(_PyTime_t* tp, struct timeval* tv)); | ^~~~~~~ /home/max/Documents/code/skybison/build-relwithdebinfo/include/skybison3.8/cpython-func.h:21:70: note: in definition of macro ‘PyAPI_FUNC_DECL’ 21 | #define PyAPI_FUNC_DECL(DECL) __attribute__((visibility("default"))) DECL | ^~~~ ```
{
"django_minimal_requests": {
"benchmark": "django_minimal_requests",
"cg_instructions before": 682502,
"cg_instructions now": 683318,
"cg_instructions ∆": "0.1%",
"interpreter_args": [],
"interpreter_name": "pyro",
"version before": "ba3fe617c745c2f297df1b98e90d1020ccbb2eb5",
"version now": "32960c735767d33f078d4538cc5a4235e52dd6c3"
}
}
|
Summary
Benchmark detailsBase vs. New
CPython vs New
Base
New
CPython
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
On some compilers, the warnings below get generated. I think it's
something to do with not defining
_POSIX_C_SOURCE
when we includetime.h
but that didn't work--so it might be a project-level settingthat we need to tweak.
In the meantime, forward declare the structs in
cpython-types.h
.