Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Wed, 11 Oct 2017 07:51:17 +0200
From: Jens Gustedt <jens.gustedt@...ia.fr>
To: musl@...ts.openwall.com,Rich Felker <dalias@...c.org>
Subject: Re: [PATCH] stdio: implement fopencookie(3)

Am 11. Oktober 2017 04:08:08 MESZ schrieb Rich Felker <dalias@...c.org>:
>On Tue, Oct 10, 2017 at 11:40:15PM +0200, Jens Gustedt wrote:
>> Hello Rich,
>> 
>> On Tue, 10 Oct 2017 16:56:54 -0400 Rich Felker <dalias@...c.org>
>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.
>> 
>> They would only be safe in the header. They are not safe on the using
>> side, I think. Something like
>> 
>>     toto->read = whatever;
>> 
>> or
>> 
>>     *toto = (cookie_io_functions_t){ .read = another, }
>> 
>> can't be protected by parenthesis.
>
>It doesn't have to be, because it doesn't have the token ( immediately
>following it.

I meant this as an example where an object-like macro would hurt. "read" is a bad example, because it is reserved. But if an application had an object-like  macro "seek" it would be screwed.

Jens 

-- 
Jens Gustedt - INRIA & ICube, Strasbourg, France 

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.