unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: Joseph Myers <joseph@codesourcery.com>
Cc: Florian Weimer <fweimer@redhat.com>, libc-alpha@sourceware.org
Subject: Re: [PATCH 2/5] nptl: Convert tst-cond11.c to use libsupport
Date: Fri, 10 May 2019 09:20:16 -0300	[thread overview]
Message-ID: <73eb7a6c-88d8-fdda-79f0-ac407a29e352@linaro.org> (raw)
In-Reply-To: <E2B3319A-9E2D-4449-B278-1D1B9288EA18@linaro.org>



On 10/05/2019 06:42, Adhemerval Zanella wrote:
> 
> 
>> Il giorno 9 mag 2019, alle ore 20:03, Joseph Myers <joseph@codesourcery.com> ha scritto:
>>
>>> On Thu, 9 May 2019, Adhemerval Zanella wrote:
>>>
>>>> On 09/05/2019 14:08, Florian Weimer wrote:
>>>> * Adhemerval Zanella:
>>>>
>>>>>> support/Makefile       |   3 +-
>>>>>> support/README         |   5 +-
>>>>>> support/timespec-add.c |  71 ++++++++++++++++++-
>>>>>> support/timespec-sub.c |  71 ++++++++++++++++++-
>>>>>> support/timespec.c     |  58 ++++++++++++++-
>>>>>> support/timespec.h     |  79 ++++++++++++++++++++-
>>>>
>>>> Could you push these changes as a separate commit?  Thanks.
>>>>
>>>> Florian
>>>>
>>> Ok, I will split the patch.
>>
>> These changes have broken the build for x32, with errors such as:
>>
>> timespec.c: In function 'test_timespec_before_impl':
>> timespec.c:32:23: error: format '%ld' expects argument of type 'long int', but argument 4 has type '__time_t' {aka 'const long long int'} [-Werror=format=]
> 
> I will check this out.
> 

I will check the following patch to fix it:

---
diff --git a/support/timespec.c b/support/timespec.c
index f1b88c1f4c..653293970a 100644
--- a/support/timespec.c
+++ b/support/timespec.c
@@ -18,6 +18,7 @@
 
 #include <support/timespec.h>
 #include <stdio.h>
+#include <stdint.h>
 
 void
 test_timespec_before_impl (const char *file, int line,
@@ -29,12 +30,12 @@ test_timespec_before_impl (const char *file, int line,
          && left.tv_nsec > right.tv_nsec)) {
     support_record_failure ();
     const struct timespec diff = timespec_sub (left, right);
-    printf ("%s:%d: %ld.%09lds not before %ld.%09lds "
-           "(difference %ld.%09lds)n",
+    printf ("%s:%d: %jd.%09jds not before %jd.%09jds "
+           "(difference %jd.%09jds)n",
            file, line,
-           left.tv_sec, left.tv_nsec,
-           right.tv_sec, right.tv_nsec,
-           diff.tv_sec, diff.tv_nsec);
+           (intmax_t) left.tv_sec, (intmax_t) left.tv_nsec,
+           (intmax_t) right.tv_sec, (intmax_t) right.tv_nsec,
+           (intmax_t) diff.tv_sec, (intmax_t) diff.tv_nsec);
   }
 }
 
@@ -48,11 +49,11 @@ test_timespec_equal_or_after_impl (const char *file, int line,
          && left.tv_nsec < right.tv_nsec)) {
     support_record_failure ();
     const struct timespec diff = timespec_sub (right, left);
-    printf ("%s:%d: %ld.%09lds not after %ld.%09lds "
-           "(difference %ld.%09lds)n",
+    printf ("%s:%d: %jd.%09jds not after %jd.%09jds "
+           "(difference %jd.%09jds)n",
            file, line,
-           left.tv_sec, left.tv_nsec,
-           right.tv_sec, right.tv_nsec,
-           diff.tv_sec, diff.tv_nsec);
+           (intmax_t) left.tv_sec, (intmax_t) left.tv_nsec,
+           (intmax_t) right.tv_sec, (intmax_t) right.tv_nsec,
+           (intmax_t) diff.tv_sec, (intmax_t) diff.tv_nsec);
   }
---

  reply	other threads:[~2019-05-10 12:20 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-02 20:54 [PATCH 0/5] Add new helper functions+macros to libsupport and use them in some nptl tests Mike Crowe
2019-05-02 20:54 ` [PATCH 1/5] support: Add xclock_gettime Mike Crowe
2019-05-08 13:46   ` Florian Weimer
2019-05-08 14:22     ` Mike Crowe
2019-05-08 15:00       ` Florian Weimer
2019-05-08 16:17         ` Mike Crowe
2019-05-08 15:11     ` Adhemerval Zanella
2019-05-02 20:54 ` [PATCH 2/5] nptl: Convert tst-cond11.c to use libsupport Mike Crowe
2019-05-09 16:39   ` Adhemerval Zanella
2019-05-09 17:08     ` Florian Weimer
2019-05-09 17:16       ` Adhemerval Zanella
2019-05-09 23:03         ` Joseph Myers
2019-05-10  9:42           ` Adhemerval Zanella
2019-05-10 12:20             ` Adhemerval Zanella [this message]
2019-05-10 12:22               ` Florian Weimer
2019-05-02 20:54 ` [PATCH 3/5] nptl: Use recent additions to libsupport in tst-sem5 Mike Crowe
2019-05-09 16:55   ` Adhemerval Zanella
2019-05-02 20:54 ` [PATCH 4/5] nptl: Convert some rwlock tests to use libsupport Mike Crowe
2019-05-09 17:25   ` Adhemerval Zanella
2019-05-02 20:54 ` [PATCH 5/5] nptl/tst-abstime: Use libsupport Mike Crowe
2019-05-09 17:26   ` Adhemerval Zanella
2019-05-03 20:38 ` [PATCH 0/5] Add new helper functions+macros to libsupport and use them in some nptl tests Mike Crowe

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

  List information: https://www.gnu.org/software/libc/involved.html

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

  git send-email \
    --in-reply-to=73eb7a6c-88d8-fdda-79f0-ac407a29e352@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=fweimer@redhat.com \
    --cc=joseph@codesourcery.com \
    --cc=libc-alpha@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).