diff options
author | sjmulder <sjmulder@pkgsrc.org> | 2020-11-18 12:18:29 +0000 |
---|---|---|
committer | sjmulder <sjmulder@pkgsrc.org> | 2020-11-18 12:18:29 +0000 |
commit | 7ca2c786f991de497eceed8bfe5991d79f41a8d5 (patch) | |
tree | 2bf49c21aedf3089baa4475f07f2a82059300189 /lang | |
parent | 859e1266c5a344e692108a7da893d1a06c778a8a (diff) | |
download | pkgsrc-7ca2c786f991de497eceed8bfe5991d79f41a8d5.tar.gz |
lang/python39: Move pragma outside function for GCC 4.4
Diffstat (limited to 'lang')
-rw-r--r-- | lang/python39/distinfo | 3 | ||||
-rw-r--r-- | lang/python39/patches/patch-Modules___zoneinfo.c | 50 |
2 files changed, 52 insertions, 1 deletions
diff --git a/lang/python39/distinfo b/lang/python39/distinfo index d680ecb7e0e..2fba3ab39b8 100644 --- a/lang/python39/distinfo +++ b/lang/python39/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.2 2020/11/12 10:58:20 sjmulder Exp $ +$NetBSD: distinfo,v 1.3 2020/11/18 12:18:29 sjmulder Exp $ SHA1 (Python-3.9.0.tar.xz) = ff1fc8c37d5d4b09ec3bf0d84f3e5b97745c6704 RMD160 (Python-3.9.0.tar.xz) = 822fd1ea11f3ca303a08317f6db61f2a1e03e5ef @@ -25,6 +25,7 @@ SHA1 (patch-Modules___ctypes_callproc.c) = 86f27c466a67ebf72d863febece33aa8b1f9f SHA1 (patch-Modules___ctypes_ctypes.h) = 641c0af4d550c9140549ce2f2df6239c2c954a06 SHA1 (patch-Modules___ctypes_malloc__closure.c) = 7e8f491ce66acb6d07e8830ee881edbf0aaac538 SHA1 (patch-Modules___decimal_libmpdec_mpdecimal.h) = 8d302abacc5737fe7620d4738fff6c5c3ed387c7 +SHA1 (patch-Modules___zoneinfo.c) = b1df24fe935cd357670a6d9f41245ab04f2015e8 SHA1 (patch-Modules_getpath.c) = d7114d21d7d9c7167fad259b115cb02e4153c531 SHA1 (patch-Modules_makesetup) = a06786eebffadecedba5e3a50a9785fb47613567 SHA1 (patch-Modules_nismodule.c) = 1bafe9b06359586d027a77011b103877590d947d diff --git a/lang/python39/patches/patch-Modules___zoneinfo.c b/lang/python39/patches/patch-Modules___zoneinfo.c new file mode 100644 index 00000000000..110f33aa23b --- /dev/null +++ b/lang/python39/patches/patch-Modules___zoneinfo.c @@ -0,0 +1,50 @@ +$NetBSD: patch-Modules___zoneinfo.c,v 1.1 2020/11/18 12:18:29 sjmulder Exp $ + +Move `#pragma GCC diagnostics` outside function for GCC 4.4. + +--- Modules/_zoneinfo.c.orig 2020-10-05 15:07:58.000000000 +0000 ++++ Modules/_zoneinfo.c +@@ -1197,6 +1197,19 @@ calendarrule_year_to_timestamp(Transitio + (int64_t)(self->minute * 60) + (int64_t)(self->second)); + } + ++// Re. `if (day < 0 || day > 6)`: ++// ++// day is an unsigned integer, so day < 0 should always return false, but ++// if day's type changes to a signed integer *without* changing this value, ++// it may create a bug. Considering that the compiler should be able to ++// optimize out the first comparison if day is an unsigned integer anyway, ++// we will leave this comparison in place and disable the compiler warning. ++// ++// Old GCC versions like 4.4 don't allow `#pragma GCC diagnostic` inside ++// functions. ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Wtype-limits" ++ + /* Constructor for CalendarRule. */ + int + calendarrule_new(uint8_t month, uint8_t week, uint8_t day, int8_t hour, +@@ -1219,15 +1232,7 @@ calendarrule_new(uint8_t month, uint8_t + return -1; + } + +- // day is an unsigned integer, so day < 0 should always return false, but +- // if day's type changes to a signed integer *without* changing this value, +- // it may create a bug. Considering that the compiler should be able to +- // optimize out the first comparison if day is an unsigned integer anyway, +- // we will leave this comparison in place and disable the compiler warning. +-#pragma GCC diagnostic push +-#pragma GCC diagnostic ignored "-Wtype-limits" + if (day < 0 || day > 6) { +-#pragma GCC diagnostic pop + PyErr_Format(PyExc_ValueError, "Day must be in [0, 6]"); + return -1; + } +@@ -1247,6 +1252,7 @@ calendarrule_new(uint8_t month, uint8_t + *out = new_offset; + return 0; + } ++#pragma GCC diagnostic pop + + /* Function to calculate the local timestamp of a transition from the year. + * |