All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Andrea Cervesato <andrea.cervesato@suse.de>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v1] Rewrite confstr01.c test using new LTP API
Date: Thu, 17 Feb 2022 09:10:04 +0100	[thread overview]
Message-ID: <Yg4C3NBVy87FlQSb@pevik> (raw)
In-Reply-To: <20220216111013.32056-1-andrea.cervesato@suse.de>

Hi,

>  #define _XOPEN_SOURCE 500
> +#include <stdlib.h>
>  #include <unistd.h>
> +#include "tst_test.h"


When including headers like this we get warning due _XOPEN_SOURCE 500

rm -f -f -r confstr01  *.o *.pyc .cache.mk *.dwo .*.dwo
In file included from ../../../../include/tst_safe_net.h:15,
                 from ../../../../include/tst_test.h:100,
                 from confstr01.c:19:
../../../../include/tst_net.h:32:74: warning: ‘struct addrinfo’ declared inside parameter list will not be visible outside of this definition or declaration
   32 |                                           const char *port, const struct addrinfo *hints,

We need to load <stdlib.h> before _XOPEN_SOURCE 500.
IMHO _XOPEN_SOURCE 500 is for <unistd.h>, which defines these _CS_XBS5* definitions,
thus safe to do.

500 (X/Open 5) is for POSIX 1995. IMHO we should update (as a separate effort).
@Cyril don't we want to test POSIX 2008 (700)? Or even 2017 (not sure how to
define it?)

Kind regards,
Petr

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

  parent reply	other threads:[~2022-02-17  8:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-16 11:10 [LTP] [PATCH v1] Rewrite confstr01.c test using new LTP API Andrea Cervesato
2022-02-16 12:59 ` Petr Vorel
2022-02-17  8:10 ` Petr Vorel [this message]
2022-04-05 13:51 ` 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=Yg4C3NBVy87FlQSb@pevik \
    --to=pvorel@suse.cz \
    --cc=andrea.cervesato@suse.de \
    --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.