public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jon TURNEY <jturney@sourceware.org>
To: cygwin-cvs@sourceware.org
Subject: [newlib-cygwin] Cygwin: testsuite: Fix TEST_RETURN for 64-bit
Date: Mon, 29 Aug 2022 16:54:41 +0000 (GMT)	[thread overview]
Message-ID: <20220829165441.693AD38582BA@sourceware.org> (raw)

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

commit 19b3b814bcba422fa468530a441c0001361aed3c
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date:   Thu Nov 26 15:33:44 2020 +0000

    Cygwin: testsuite: Fix TEST_RETURN for 64-bit
    
    The result of a function call won't fit in an int if it's e.g. a pointer.

Diff:
---
 winsup/testsuite/libltp/include/usctest.h | 6 +++---
 winsup/testsuite/libltp/lib/parse_opts.c  | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/winsup/testsuite/libltp/include/usctest.h b/winsup/testsuite/libltp/include/usctest.h
index 6a095db1c..fef349d04 100644
--- a/winsup/testsuite/libltp/include/usctest.h
+++ b/winsup/testsuite/libltp/include/usctest.h
@@ -159,7 +159,7 @@ struct usc_errno_t {
  **********************************************************************/
 #ifdef  _USC_LIB_
 
-extern int TEST_RETURN;
+extern long TEST_RETURN;
 extern int TEST_ERRNO;
 
 #else
@@ -173,7 +173,7 @@ extern struct usc_errno_t TEST_VALID_ENO[USC_MAX_ERRNO];
  * Globals for returning the return code and errno from the system call
  * test macros.
  ***********************************************************************/
-extern int TEST_RETURN;
+extern long TEST_RETURN;
 extern int TEST_ERRNO;
 
 /***********************************************************************
@@ -210,7 +210,7 @@ extern void STD_opts_help();
  *	SCALL = system call and parameters to execute
  *
  ***********************************************************************/
-#define TEST(SCALL) TEST_RETURN = (unsigned) SCALL;  TEST_ERRNO=errno;
+#define TEST(SCALL) TEST_RETURN = SCALL;  TEST_ERRNO=errno;
 
 /***********************************************************************
  * TEST_VOID: calls a system call
diff --git a/winsup/testsuite/libltp/lib/parse_opts.c b/winsup/testsuite/libltp/lib/parse_opts.c
index 0282a0976..1f41bfdd2 100644
--- a/winsup/testsuite/libltp/lib/parse_opts.c
+++ b/winsup/testsuite/libltp/lib/parse_opts.c
@@ -110,7 +110,7 @@ struct usc_errno_t TEST_VALID_ENO[USC_MAX_ERRNO];
    * Globals for returning the return code and errno from the system call
    * test macros.
    ***********************************************************************/
-int TEST_RETURN;
+long TEST_RETURN;
 int TEST_ERRNO;
 
   /***********************************************************************

                 reply	other threads:[~2022-08-29 16:54 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=20220829165441.693AD38582BA@sourceware.org \
    --to=jturney@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).