public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
From: Corinna Vinschen <corinna@sourceware.org>
To: cygwin-cvs@sourceware.org
Subject: [newlib-cygwin] localtime define _DIAGASSERT
Date: Mon,  4 May 2020 09:21:16 +0000 (GMT)	[thread overview]
Message-ID: <20200504092116.A0782383E832@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=453b6d17bf0581e55258c5eb6dc7afbad1927cab

commit 453b6d17bf0581e55258c5eb6dc7afbad1927cab
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Wed Apr 29 09:51:52 2020 +0200

    localtime define _DIAGASSERT

Diff:
---
 winsup/cygwin/localtime.cc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/winsup/cygwin/localtime.cc b/winsup/cygwin/localtime.cc
index dccaa623a..ebb2d42f0 100644
--- a/winsup/cygwin/localtime.cc
+++ b/winsup/cygwin/localtime.cc
@@ -73,6 +73,8 @@ static char	privatehid[] = "@(#)private.h	7.48";
 #include "unistd.h"	/* for F_OK and R_OK */
 #if 0
 #include <assert.h>
+#else
+#define _DIAGASSERT(e)
 #endif
 
 /* Unlike <ctype.h>'s isdigit, this also works if c < 0 | c > UCHAR_MAX.  */
@@ -786,7 +788,7 @@ tzload(timezone_t sp, const char *name, const int doextend)
 					sp->types[i - 1] = 1;
 					sp->ats[timecnt++] = time_t_min;
 				}
-				//_DIAGASSERT(__type_fit(time_t, at));
+				_DIAGASSERT(__type_fit(time_t, at));
 				sp->ats[timecnt++] = (time_t)at;
 			}
 			p += stored;
@@ -1988,7 +1990,7 @@ timesub(const timezone_t sp, const time_t *const timep,
 		if (! ((! TYPE_SIGNED(time_t) || INT_MIN <= tdelta)
 		       && tdelta <= INT_MAX))
 			return NULL;
-		//_DIAGASSERT(__type_fit(int, tdelta));
+		_DIAGASSERT(__type_fit(int, tdelta));
 		idelta = (int)tdelta;
 		if (idelta == 0)
 			idelta = (tdays < 0) ? -1 : 1;


                 reply	other threads:[~2020-05-04  9:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200504092116.A0782383E832@sourceware.org \
    --to=corinna@sourceware.org \
    --cc=cygwin-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).