From 9ba301e589b47af776294804240cc10e08e38498 Mon Sep 17 00:00:00 2001 From: Nicholas Bastin Date: Thu, 15 Jul 2004 15:54:05 +0000 Subject: [PATCH] Moved SunPro warning suppression into pyport.h and out of individual modules and objects. --- Include/pyport.h | 7 +++++++ Modules/_sre.c | 4 ---- Modules/collectionsmodule.c | 4 ---- Objects/dictobject.c | 4 ---- Objects/listobject.c | 4 ---- Objects/setobject.c | 4 ---- Objects/unicodeobject.c | 4 ---- 7 files changed, 7 insertions(+), 24 deletions(-) diff --git a/Include/pyport.h b/Include/pyport.h index 7477f07d260..0ee42f0f4ed 100644 --- a/Include/pyport.h +++ b/Include/pyport.h @@ -579,4 +579,11 @@ typedef struct fd_set { #define Py_GCC_ATTRIBUTE(x) __attribute__(x) #endif +/* Eliminate end-of-loop code not reached warnings from SunPro C + * when using do{...}while(0) macros + */ +#ifdef __SUNPRO_C +#pragma error_messages (off,E_END_OF_LOOP_CODE_NOT_REACHED) +#endif + #endif /* Py_PYPORT_H */ diff --git a/Modules/_sre.c b/Modules/_sre.c index 6ee0bb82d3b..4be33d04ca8 100644 --- a/Modules/_sre.c +++ b/Modules/_sre.c @@ -34,10 +34,6 @@ * other compatibility work. */ -#ifdef __SUNPRO_C -#pragma error_messages (off,E_END_OF_LOOP_CODE_NOT_REACHED) -#endif - #ifndef SRE_RECURSIVE static char copyright[] = diff --git a/Modules/collectionsmodule.c b/Modules/collectionsmodule.c index 367b4441e28..c72c7a6d06c 100644 --- a/Modules/collectionsmodule.c +++ b/Modules/collectionsmodule.c @@ -1,10 +1,6 @@ #include "Python.h" #include "structmember.h" -#ifdef __SUNPRO_C -#pragma error_messages (off,E_END_OF_LOOP_CODE_NOT_REACHED) -#endif - /* collections module implementation of a deque() datatype Written and maintained by Raymond D. Hettinger Copyright (c) 2004 Python Software Foundation. diff --git a/Objects/dictobject.c b/Objects/dictobject.c index 252db8ad910..70f05e5def3 100644 --- a/Objects/dictobject.c +++ b/Objects/dictobject.c @@ -9,10 +9,6 @@ #include "Python.h" -#ifdef __SUNPRO_C -#pragma error_messages (off,E_END_OF_LOOP_CODE_NOT_REACHED) -#endif - typedef PyDictEntry dictentry; typedef PyDictObject dictobject; diff --git a/Objects/listobject.c b/Objects/listobject.c index 4385e4b01fd..ac8cd335a4e 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -2,10 +2,6 @@ #include "Python.h" -#ifdef __SUNPRO_C -#pragma error_messages (off,E_END_OF_LOOP_CODE_NOT_REACHED) -#endif - #ifdef STDC_HEADERS #include #else diff --git a/Objects/setobject.c b/Objects/setobject.c index e94f9204007..289d5d3d964 100644 --- a/Objects/setobject.c +++ b/Objects/setobject.c @@ -10,10 +10,6 @@ All rights reserved. */ -#ifdef __SUNPRO_C -#pragma error_messages (off,E_END_OF_LOOP_CODE_NOT_REACHED) -#endif - static PyObject * set_update(PySetObject *so, PyObject *other) { diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 00ccea8d4c5..6c73df48d36 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -41,10 +41,6 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "unicodeobject.h" #include "ucnhash.h" -#ifdef __SUNPRO_C -#pragma error_messages (off,E_END_OF_LOOP_CODE_NOT_REACHED) -#endif - #ifdef MS_WINDOWS #include #endif