Commit 602e07d
util.c: fix _WIN32 port of strptime (jqlang#3071)
In windows, time_t is a signed 32-bit integer type, so TIME_MAX needs to
be declared as INT32_MAX instead of INT64_MAX.
Also bump NetBSD's strptime to revision 1.65 from 1.63 to fix undefined
behaviour (signed integer overflow) bugs.
Related NetBSD problem report:
https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=58041
Noticed thanks to a compiler warning in the windows build CI.
I declared the d variable as time_t instead of as unsigned to ensure
that the signedness/size of TIME_MAX-d in the sse > TIME_MAX-d check
is always correct, and to prevent -Wsign-compare warnings from
triggering in the windows build.1 parent e8bb425 commit 602e07d
1 file changed
+31
-24
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
818 | 818 | | |
819 | 819 | | |
820 | 820 | | |
821 | | - | |
822 | | - | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
823 | 826 | | |
824 | | - | |
825 | | - | |
826 | | - | |
827 | | - | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
828 | 834 | | |
829 | | - | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
830 | 839 | | |
831 | | - | |
| 840 | + | |
832 | 841 | | |
833 | | - | |
834 | | - | |
835 | | - | |
836 | | - | |
837 | | - | |
838 | | - | |
839 | | - | |
840 | | - | |
841 | | - | |
| 842 | + | |
| 843 | + | |
842 | 844 | | |
843 | | - | |
| 845 | + | |
844 | 846 | | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
845 | 852 | | |
846 | | - | |
| 853 | + | |
847 | 854 | | |
848 | | - | |
| 855 | + | |
849 | 856 | | |
850 | | - | |
851 | | - | |
852 | | - | |
853 | | - | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
854 | 860 | | |
| 861 | + | |
855 | 862 | | |
856 | 863 | | |
857 | 864 | | |
| |||
0 commit comments