Skip to content

Commit

Permalink
quench warnings on some platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
wjakob committed Sep 27, 2024
1 parent 81e761e commit 7fad726
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion include/nanobind/stl/detail/chrono.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@
// in order to be able to handle errors better.

#if !defined(Py_LIMITED_API) && !defined(PYPY_VERSION)
#include <datetime.h>
# include <datetime.h>
#endif

#if defined(__GNUC__)
// warning: warning: declaration of '...' with attribute 'noinline' follows inline declaration
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wattributes"
#endif

NAMESPACE_BEGIN(NB_NAMESPACE)
Expand Down Expand Up @@ -287,3 +293,7 @@ inline PyObject* pack_datetime(int year, int month, int day,
}

#endif // !defined(Py_LIMITED_API) && !defined(PYPY_VERSION)
//
#if defined(__GNUC__)
# pragma GCC diagnostic pop
#endif
2 changes: 1 addition & 1 deletion src/nb_func.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1341,7 +1341,7 @@ PyObject *nb_func_get_doc(PyObject *self, void *) {
const func_data *fi = f + i;
nb_func_render_signature(fi);
buf.put('\n');
doc_found |= fi->flags & (uint32_t) func_flags::has_doc;
doc_found |= (fi->flags & (uint32_t) func_flags::has_doc) != 0;
}

if (doc_found) {
Expand Down

0 comments on commit 7fad726

Please sign in to comment.