pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/lang/python39



Module Name:    pkgsrc
Committed By:   sjmulder
Date:           Wed Nov 18 12:18:29 UTC 2020

Modified Files:
        pkgsrc/lang/python39: distinfo
Added Files:
        pkgsrc/lang/python39/patches: patch-Modules___zoneinfo.c

Log Message:
lang/python39: Move pragma outside function for GCC 4.4


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 pkgsrc/lang/python39/distinfo
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/lang/python39/patches/patch-Modules___zoneinfo.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/lang/python39/distinfo
diff -u pkgsrc/lang/python39/distinfo:1.2 pkgsrc/lang/python39/distinfo:1.3
--- pkgsrc/lang/python39/distinfo:1.2   Thu Nov 12 10:58:20 2020
+++ pkgsrc/lang/python39/distinfo       Wed Nov 18 12:18:29 2020
@@ -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)
 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

Added files:

Index: pkgsrc/lang/python39/patches/patch-Modules___zoneinfo.c
diff -u /dev/null pkgsrc/lang/python39/patches/patch-Modules___zoneinfo.c:1.1
--- /dev/null   Wed Nov 18 12:18:29 2020
+++ pkgsrc/lang/python39/patches/patch-Modules___zoneinfo.c     Wed Nov 18 12:18:29 2020
@@ -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.
+  *



Home | Main Index | Thread Index | Old Index