This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Arfrever
Recipients Arfrever, eryksun, ezio.melotti, pitrou, serhiy.storchaka, vstinner
Date 2016-11-06.17:21:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1478452898.14.0.386697606463.issue19569@psf.upfronthosting.co.za>
In-reply-to
Content
_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;
}
History
Date User Action Args
2016-11-06 17:21:38Arfreversetrecipients: + Arfrever, pitrou, vstinner, ezio.melotti, serhiy.storchaka, eryksun
2016-11-06 17:21:38Arfreversetmessageid: <1478452898.14.0.386697606463.issue19569@psf.upfronthosting.co.za>
2016-11-06 17:21:38Arfreverlinkissue19569 messages
2016-11-06 17:21:37Arfrevercreate