public inbox for [email protected]
 help / color / mirror / Atom feed
From: Ammar Faizi <[email protected]>
To: Dylan Yudaken <[email protected]>
Cc: Facebook Kernel Team <[email protected]>,
	io-uring Mailing List <[email protected]>,
	Jens Axboe <[email protected]>,
	Pavel Begunkov <[email protected]>,
	Ammar Faizi <[email protected]>
Subject: Re: [PATCH liburing 0/5] multishot recvmsg docs and example
Date: Wed, 27 Jul 2022 17:19:12 +0700	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

On 7/27/22 5:11 PM, Ammar Faizi wrote:
> So -D_GNU_SOURCE is the culprit. It seems to be unavoidable as
> the warn seems to be compiler specific or something. Maybe that
> _GNU_SOURCE patches the definition of bind().

I did:

   gcc -E -D_GNU_SOURCE test.c -o xtest.c

and examined the xtest.c output.

So basically when we use _GNU_SOURCE, sometimes the declaration of
bind() is like this:

extern int bind (int __fd, __CONST_SOCKADDR_ARG __addr, socklen_t __len)
      __attribute__ ((__nothrow__ , __leaf__));

With __CONST_SOCKADDR_ARG being a union:

typedef union {
     const struct sockaddr *__restrict __sockaddr__;
     const struct sockaddr_at *__restrict __sockaddr_at__;
     const struct sockaddr_ax25 *__restrict __sockaddr_ax25__;
     const struct sockaddr_dl *__restrict __sockaddr_dl__;
     const struct sockaddr_eon *__restrict __sockaddr_eon__;
     const struct sockaddr_in *__restrict __sockaddr_in__;
     const struct sockaddr_in6 *__restrict __sockaddr_in6__;
     const struct sockaddr_inarp *__restrict __sockaddr_inarp__;
     const struct sockaddr_ipx *__restrict __sockaddr_ipx__;
     const struct sockaddr_iso *__restrict __sockaddr_iso__;
     const struct sockaddr_ns *__restrict __sockaddr_ns__;
     const struct sockaddr_un *__restrict __sockaddr_un__;
     const struct sockaddr_x25 *__restrict __sockaddr_x25__;
} __CONST_SOCKADDR_ARG __attribute__ ((__transparent_union__));

But not all header file included by the compiler has this union stuff.
When it doesn't, it will throw a warning like that.

-- 
Ammar Faizi

      reply	other threads:[~2022-07-27 10:19 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-26 12:14 [PATCH liburing 0/5] multishot recvmsg docs and example Dylan Yudaken
2022-07-26 12:14 ` [PATCH liburing 1/5] more consistent multishot recvmsg API parameter names Dylan Yudaken
2022-07-26 12:14 ` [PATCH liburing 2/5] order like functions together in liburing.h Dylan Yudaken
2022-07-26 12:15 ` [PATCH liburing 3/5] change io_uring_recvmsg_payload_length return type Dylan Yudaken
2022-07-26 12:15 ` [PATCH liburing 4/5] add documentation for multishot recvmsg Dylan Yudaken
2022-07-26 12:15 ` [PATCH liburing 5/5] add an example for a UDP server Dylan Yudaken
2022-07-26 16:23 ` [PATCH liburing 0/5] multishot recvmsg docs and example Jens Axboe
2022-07-26 16:32   ` Ammar Faizi
2022-07-26 16:40     ` Jens Axboe
2022-07-26 16:48       ` Ammar Faizi
2022-07-26 16:49         ` Jens Axboe
2022-07-27  7:57           ` Dylan Yudaken
2022-07-27  9:59             ` Ammar Faizi
2022-07-27 10:11               ` Ammar Faizi
2022-07-27 10:19                 ` Ammar Faizi [this message]

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 \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /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