public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH V2 1/2] tst_timer: Add time64 related helpers
Date: Wed, 15 Apr 2020 14:24:03 +0200	[thread overview]
Message-ID: <20200415122403.GF12705@rei.lan> (raw)
In-Reply-To: <CAK8P3a2cwb1Lh5nJ4DRdDF4ADnON5axRkxUR+g4impceqbHABw@mail.gmail.com>

Hi!
> > > This introduces a new set of helpers to handle the time64 related
> > > timespec. Instead of duplicating the code, this moves the existing code
> > > into a macro and then defines timespec and time64 related helpers using
> > > it.
> >
> > I'm not sure that adding a macro that spans over ~150 lines is a good
> > idea. Unfortunately there is not so much options for a C language that
> > lacks generics.
> >
> > Maybe it would be slightly better to write a shell script that would
> > generate these defintions into a separate header that would be included
> > in the tst_timer.h. That way we can run it manually to regenerate the
> > header if needed. At least we would get saner error message from
> > compiler that way.
> 
> How about having a shared .c file that is built multiple times with different
> sets of -DBUILD_FOO options set from the Makefile, and a small
> number of #ifdefs inside that file?

Actually after looking at the test it may be better to build abstract
type system as I described in the reply to the second email just now.

-- 
chrubis@suse.cz

  reply	other threads:[~2020-04-15 12:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-14 11:00 [LTP] [PATCH V2 0/2] syscalls/clock_gettime: Add support for time64 tests Viresh Kumar
2020-04-14 11:00 ` [LTP] [PATCH V2 1/2] tst_timer: Add time64 related helpers Viresh Kumar
2020-04-15 11:52   ` Cyril Hrubis
2020-04-15 12:07     ` Arnd Bergmann
2020-04-15 12:24       ` Cyril Hrubis [this message]
2020-04-14 11:00 ` [LTP] [PATCH V2 2/2] syscalls/clock_gettime: Add support for time64 tests Viresh Kumar
2020-04-15 12:22   ` Cyril Hrubis

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=20200415122403.GF12705@rei.lan \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    /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