All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Jan Stancek <jstancek@redhat.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 1/2] lapi/fs: Include lapi/fcntl.h + define _GNU_SOURCE
Date: Thu, 25 Apr 2024 17:38:46 +0200	[thread overview]
Message-ID: <20240425153846.GA291548@pevik> (raw)
In-Reply-To: <CAASaF6yfGK5zHMW0wQxWM+r+6=dT_sT+5HSqJPLadhQ1O85KZw@mail.gmail.com>

Hi Jan, all,

...
> > OK, this will work, just lapi/fs.h must be loaded before tst_test.h,
> > othewise it would fail on Alpine:

> So this is essentially:
> ------------------------------------------
> #include <fcntl.h> // from tst_test.h include chain
> #define _GNU_SOURCE // from lapi/fs.h
> #include <fcntl.h>

> int main(void)
> {
>         loff_t asd;
>         return 0;
> }
> ------------------------------------------

> and it doesn't compile. And same applies if you include first any of
> these first:
> include/lapi/fcntl.h:#include <fcntl.h>
> include/lapi/io_uring.h:#include <fcntl.h>
> include/lapi/pidfd.h:#include <fcntl.h>
> include/safe_macros_fn.h:#include <fcntl.h>
> include/tst_safe_macros.h:#include <fcntl.h>

> Do we really need for tst_max_lfs_filesize() to return loff_t? If we
> changed it to "long long",
> we'd avoid lot of issues with includes and _GNU_SOURCE for just single
> user of this function.

+1. We might get extra warning when there is 32 bit, but it would make things
much easier => I'll send another version.

Kind regards,
Petr


> > In file included from unlink09.c:20:
> > ../../../../include/lapi/fs.h:61:15: error: unknown type name 'loff_t'
> >    61 | static inline loff_t tst_max_lfs_filesize(void)
> >       |               ^~~~~~
> > ../../../../include/lapi/fs.h: In function 'tst_max_lfs_filesize':
> > ../../../../include/lapi/fs.h:64:17: error: 'loff_t' undeclared (first use in this function); did you mean 'off_t'?
> >    64 |         return (loff_t)LLONG_MAX;
> >       |                 ^~~~~~
> >       |                 off_t
> > ../../../../include/lapi/fs.h:64:17: note: each undeclared identifier is reported only once for each function it appears in
> > ../../../../include/lapi/fs.h:64:24: error: expected ';' before numeric constant
> >    64 |         return (loff_t)LLONG_MAX;
> >       |                        ^
> >       |                        ;
> > make: *** [../../../../include/mk/rules.mk:45: unlink09] Error 1

> > (glibc hides loff_t behind __USE_MISC, which I thought it it's in the end
> > _GNU_SOURCE, but obviously not).
...

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2024-04-25 15:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-23 13:28 [LTP] [PATCH 0/2] Build fixes Petr Vorel
2024-04-23 13:28 ` [LTP] [PATCH 1/2] lapi/fs: Include lapi/fcntl.h + define _GNU_SOURCE Petr Vorel
2024-04-24  7:59   ` Jan Stancek
2024-04-24 12:17     ` Petr Vorel
2024-04-25 13:23       ` Jan Stancek
2024-04-25 15:38         ` Petr Vorel [this message]
2024-04-23 13:28 ` [LTP] [PATCH 2/2] lapi: getrandom05: Add getrandom() fallback Petr Vorel
2024-04-23 13:30 ` [LTP] [PATCH 0/2] Build fixes Petr Vorel

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=20240425153846.GA291548@pevik \
    --to=pvorel@suse.cz \
    --cc=jstancek@redhat.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.