]> granicus.if.org Git - python/commitdiff
Issue #13338: Handle all enumerations in _Py_ANNOTATE_MEMORY_ORDER
authorPetri Lehtinen <petri@digip.org>
Sat, 19 Nov 2011 20:03:10 +0000 (22:03 +0200)
committerPetri Lehtinen <petri@digip.org>
Sat, 19 Nov 2011 20:03:10 +0000 (22:03 +0200)
This allows compiling extension modules with -Wswitch-enum on gcc.
Initial patch by Floris Bruynooghe.

Include/pyatomic.h
Misc/ACKS
Misc/NEWS

index b0028fd92fa37c6fe086658e3e822b4476290778..da45327b89c982cd11033dba2ffa43966ff5981e 100644 (file)
@@ -64,7 +64,8 @@ _Py_ANNOTATE_MEMORY_ORDER(const volatile void *address, _Py_memory_order order)
     case _Py_memory_order_seq_cst:
         _Py_ANNOTATE_HAPPENS_BEFORE(address);
         break;
-    default:
+    case _Py_memory_order_relaxed:
+    case _Py_memory_order_acquire:
         break;
     }
     switch(order) {
@@ -73,7 +74,8 @@ _Py_ANNOTATE_MEMORY_ORDER(const volatile void *address, _Py_memory_order order)
     case _Py_memory_order_seq_cst:
         _Py_ANNOTATE_HAPPENS_AFTER(address);
         break;
-    default:
+    case _Py_memory_order_relaxed:
+    case _Py_memory_order_release:
         break;
     }
 }
index a82e0c91ac700bad43f74c18fa0adb6c7d032cc7..c66edb7ab175e99e845dde811df22bcd6fa7a5c6 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -124,6 +124,7 @@ Gary S. Brown
 Oleg Broytmann
 Dave Brueck
 Francisco Martín Brugué
+Floris Bruynooghe
 Stan Bubrouski
 Erik de Bueger
 Dick Bulterman
index 513984d6dee11f394ab26d752d3ae55ee74c0174..c3765dd973bda544b6e6cf4be7ddc0d4ac80bd4d 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -10,6 +10,10 @@ What's New in Python 3.2.3?
 Core and Builtins
 -----------------
 
+- Issue #13338: Handle all enumerations in _Py_ANNOTATE_MEMORY_ORDER
+  to allow compiling extension modules with -Wswitch-enum on gcc.
+  Initial patch by Floris Bruynooghe.
+
 - Issue #13333: The UTF-7 decoder now accepts lone surrogates (the encoder
   already accepts them).