mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: [PATCH] stdio: implement fopencookie(3)
Date: Tue, 10 Oct 2017 22:09:49 -0400	[thread overview]
Message-ID: <20171011020949.GL1627@brightrain.aerifal.cx> (raw)
In-Reply-To: <CANv4PNm0owrMKgCETkyBXQ=ZkNhjyir+k5WJMX=uFTspRCcE_A@mail.gmail.com>

On Tue, Oct 10, 2017 at 06:58:30PM -0400, Morten Welinder wrote:
> > Also note that while standard functions in POSIX can additionally be
> > defined as function-like macros, they can't be object-like macros, so
> > (*read), etc. are safe due to the parentheses.
> 
> I'm not sure that's true.  Solaris defines (or used to, at least),
> say, "open" to "open64" under the right conditions.  With that, actual
> field names in the structure ends up being dependent on #include
> order.  Quite a mess and worse for "stat" since "struct stat" gets
> renamed in addition to the function.
> 
> "#define open my_table.my_open" would be fun too.  I haven't seen that
> in the wild, though.

If so that's just a bug in Solaris's headers, for two reasons:

(1) It's an object-like macro not a function-like macro.

(2) It doesn't work if the application does #undef open, which is
explicitly permitted.

Rich


  reply	other threads:[~2017-10-11  2:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-10 18:03 William Pitcock
2017-10-10 18:51 ` Jens Gustedt
2017-10-10 20:56   ` Rich Felker
2017-10-10 21:40     ` Jens Gustedt
2017-10-11  2:08       ` Rich Felker
2017-10-11  5:51         ` Jens Gustedt
2017-10-10 22:58     ` Morten Welinder
2017-10-11  2:09       ` Rich Felker [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-10-10 23:27 William Pitcock
2017-10-05  6:48 William Pitcock
2017-10-05 10:10 ` Szabolcs Nagy

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=20171011020949.GL1627@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=musl@lists.openwall.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).