Message280154
_Pragma syntax would be more suitable since it could be used with macros:
https://gcc.gnu.org/onlinedocs/gcc-6.2.0/cpp/Pragmas.html
Then Include/pyport.h (which defines Py_DEPRECATED) could also define:
#if defined(__GNUC__) && ((__GNUC__ >= 5) || (__GNUC__ == 4) && (__GNUC_MINOR__ >= 6))
#define Py_COMPILER_DIAGNOSTIC_PUSH _Pragma("GCC diagnostic push")
#define Py_COMPILER_DIAGNOSTIC_IGNORE_DEPRECATED_DECLARATIONS _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
#define Py_COMPILER_DIAGNOSTIC_POP _Pragma("GCC diagnostic pop")
#else
#define Py_COMPILER_DIAGNOSTIC_PUSH
#define Py_COMPILER_DIAGNOSTIC_IGNORE_DEPRECATED_DECLARATIONS
#define Py_COMPILER_DIAGNOSTIC_POP
#endif
These macros would be used in this way:
void some_function(void)
{
int x, y;
Py_COMPILER_DIAGNOSTIC_PUSH
Py_COMPILER_DIAGNOSTIC_IGNORE_DEPRECATED_DECLARATIONS
x = some_deprecated_function();
Py_COMPILER_DIAGNOSTIC_POP
y = x + 1;
} |
|
Date |
User |
Action |
Args |
2016-11-06 17:21:38 | Arfrever | set | recipients:
+ Arfrever, pitrou, vstinner, ezio.melotti, serhiy.storchaka, eryksun |
2016-11-06 17:21:38 | Arfrever | set | messageid: <1478452898.14.0.386697606463.issue19569@psf.upfronthosting.co.za> |
2016-11-06 17:21:38 | Arfrever | link | issue19569 messages |
2016-11-06 17:21:37 | Arfrever | create | |
|