[Python-checkins] cpython: Silenced minor GCC warnings.

serhiy.storchaka python-checkins at python.org
Thu Feb 26 14:28:25 CET 2015


https://hg.python.org/cpython/rev/7c6e3358221a
changeset:   94756:7c6e3358221a
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Thu Feb 26 15:27:57 2015 +0200
summary:
  Silenced minor GCC warnings.

files:
  Modules/_ctypes/_ctypes.c    |  5 +++--
  Modules/_testcapimodule.c    |  7 +++++++
  Modules/socketmodule.c       |  7 +++++++
  Programs/_freeze_importlib.c |  2 +-
  4 files changed, 18 insertions(+), 3 deletions(-)


diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c
--- a/Modules/_ctypes/_ctypes.c
+++ b/Modules/_ctypes/_ctypes.c
@@ -2819,8 +2819,9 @@
                src->b_ptr,
                size);
 
-        if (PyCPointerTypeObject_Check(type))
-            /* XXX */;
+        if (PyCPointerTypeObject_Check(type)) {
+            /* XXX */
+        }
 
         value = GetKeepedObjects(src);
         if (value == NULL)
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
--- a/Modules/_testcapimodule.c
+++ b/Modules/_testcapimodule.c
@@ -69,6 +69,10 @@
 static PyObject*
 test_sizeof_c_types(PyObject *self)
 {
+#ifdef __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wtype-limits"
+#endif
 #define CHECK_SIZEOF(TYPE, EXPECTED)         \
     if (EXPECTED != sizeof(TYPE))  {         \
         PyErr_Format(TestError,              \
@@ -126,6 +130,9 @@
 #undef IS_SIGNED
 #undef CHECK_SIGNESS
 #undef CHECK_SIZEOF
+#ifdef __GNUC__
+#pragma GCC diagnostic pop
+#endif
 }
 
 
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -1966,8 +1966,15 @@
     #pragma clang diagnostic push
     #pragma clang diagnostic ignored "-Wtautological-compare"
     #endif
+    #ifdef __GNUC__
+    #pragma GCC diagnostic push
+    #pragma GCC diagnostic ignored "-Wtype-limits"
+    #endif
     if (msg->msg_controllen < 0)
         return 0;
+    #ifdef __GNUC__
+    #pragma GCC diagnostic pop
+    #endif
     #ifdef __clang__
     #pragma clang diagnostic pop
     #endif
diff --git a/Programs/_freeze_importlib.c b/Programs/_freeze_importlib.c
--- a/Programs/_freeze_importlib.c
+++ b/Programs/_freeze_importlib.c
@@ -17,7 +17,7 @@
    of frozen modules instead, left deliberately blank so as to avoid
    unintentional import of a stale version of _frozen_importlib. */
 
-const static struct _frozen _PyImport_FrozenModules[] = {
+static const struct _frozen _PyImport_FrozenModules[] = {
     {0, 0, 0} /* sentinel */
 };
 

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list