From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/11999 Path: news.gmane.org!.POSTED!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] stdio: implement fopencookie(3) Date: Tue, 10 Oct 2017 22:09:49 -0400 Message-ID: <20171011020949.GL1627@brightrain.aerifal.cx> References: <20171010180356.11352-1-nenolod@dereferenced.org> <20171010205117.3deabfc7@inria.fr> <20171010205654.GJ1627@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1507687813 4046 195.159.176.226 (11 Oct 2017 02:10:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 11 Oct 2017 02:10:13 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-12012-gllmg-musl=m.gmane.org@lists.openwall.com Wed Oct 11 04:10:05 2017 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1e26T5-0007RP-RV for gllmg-musl@m.gmane.org; Wed, 11 Oct 2017 04:09:55 +0200 Original-Received: (qmail 5175 invoked by uid 550); 11 Oct 2017 02:10:01 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 5153 invoked from network); 11 Oct 2017 02:10:01 -0000 Content-Disposition: inline In-Reply-To: Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:11999 Archived-At: 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