| delorie.com/archives/browse.cgi | search |
| X-Recipient: | archive-cygwin AT delorie DOT com |
| DomainKey-Signature: | a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id |
| :list-unsubscribe:list-subscribe:list-archive:list-post | |
| :list-help:sender:mime-version:content-type | |
| :content-transfer-encoding:date:from:to:subject:message-id; q= | |
| dns; s=default; b=nQi8gMy4p+CCTzGJe526FfBU0iuUABFcgnvCVi/FIeLsiO | |
| tiEDyyVW1l4OeHCN6vdM7Btw2UsJ46rpVQTfwSHCXtQVvgAFbJtV983ohj0o0IZu | |
| NjfZ1PrtjaQBF8/+jL/BETysEJhoirXVhWBA59KMv7JSire2+f/quOM1+YXAs= | |
| DKIM-Signature: | v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id |
| :list-unsubscribe:list-subscribe:list-archive:list-post | |
| :list-help:sender:mime-version:content-type | |
| :content-transfer-encoding:date:from:to:subject:message-id; s= | |
| default; bh=CORWCfQbn/Z0mG/HN0VZCxzipG4=; b=q1OV5Nh99JWKD7V/k/8F | |
| ieUqqVkRWUpwboG6Y1OqtHZKxgZyRck1lpLWxaeulSRZgiKbAp1S/zT4ceXaHyVq | |
| QYFyTu7mEFHT4rNgDqf4s00RH+NqX6FZnLLw7AC3igVhNx2dXFdDeqvvUsL2c2FV | |
| jHZlGI7hyRSTFmwgmENgUUw= | |
| Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
| List-Id: | <cygwin.cygwin.com> |
| List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
| List-Archive: | <http://sourceware.org/ml/cygwin/> |
| List-Post: | <mailto:cygwin AT cygwin DOT com> |
| List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
| Sender: | cygwin-owner AT cygwin DOT com |
| Mail-Followup-To: | cygwin AT cygwin DOT com |
| Delivered-To: | mailing list cygwin AT cygwin DOT com |
| X-Spam-SWARE-Status: | No, score=-1.1 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_NO autolearn=ham version=3.3.1 |
| MIME-Version: | 1.0 |
| Date: | Mon, 13 May 2013 09:08:44 +0200 |
| From: | Denis Excoffier <cygwin AT Denis-Excoffier DOT org> |
| To: | <cygwin AT cygwin DOT com> |
| Subject: | mktime loop |
| Message-ID: | <5244063b734b165baf34bdebaff0aca5@denis-excoffier.org> |
| X-Sender: | cygwin AT Denis-Excoffier DOT org |
| User-Agent: | Roundcube Webmail/0.7.2 |
Hello,
The following program (see below) is working properly under plain
1.7.18. With all the snapshots afterwards (including
the current one 20130508), it fails after day=19, looping forever (it
seems). I use XP.
Regards,
Denis Excoffier.
% cat foo.c
#include <stdio.h>
#include <time.h>
int
main ()
{
int day;
// date --date='@2147483647' +%Y-%m-%d gives 2038-01-19
for ( day = 1 ; day <= 31 ; ++day ) {
struct tm tm;
time_t now;
tm.tm_year = 2038 - 1900;
tm.tm_mon = 1 - 1;
tm.tm_mday = day; // 19, 20
tm.tm_hour = 0;
tm.tm_min = 0;
tm.tm_sec = 0;
now = mktime (&tm);
fprintf (stderr, "day=%d\n", day);
};
return 0;
}
%
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |