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 <>
To:,Rich Felker <>
Subject: Re: [PATCH] stdio: implement fopencookie(3)

Am 11. Oktober 2017 04:08:08 MESZ schrieb Rich Felker <>:
>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 <>
>> > Also note that while standard functions in POSIX can additionally
>> > defined as function-like macros, they can't be object-like macros,
>> > (*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 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.