Re: RFC: libkern version of inet_ntoa_r

2012-07-30 Thread Lev Serebryakov
Hello, Arnaud. You wrote 30 июля 2012 г., 2:30:21: >> It looks very gcc-ish. AL> could you back your point with a technical argument, please ? This AL> sounds rather FUD'ish so far. AL> The ({ ... }) is nothing more than a primary-expression enclosing a AL> compound-statement; And how will it r

Re: RFC: libkern version of inet_ntoa_r

2012-07-29 Thread Arnaud Lacombe
Hi, On Sun, Jul 29, 2012 at 4:30 PM, Lev Serebryakov wrote: > Hello, Luigi. > You wrote 30 июля 2012 г., 0:47:21: > >>> #define fn(x) ({ fn(x, 42); }) > LR> nice trick, one always learns something on these lists... > LR> now i wonder how it works with MSVC (windows being one of the > LR> other

Re: RFC: libkern version of inet_ntoa_r

2012-07-29 Thread Lev Serebryakov
Hello, Luigi. You wrote 30 июля 2012 г., 0:47:21: >> #define fn(x) ({ fn(x, 42); }) LR> nice trick, one always learns something on these lists... LR> now i wonder how it works with MSVC (windows being one of the LR> other platforms where i need to build the ipfw+dummynet code...) It looks very

Re: RFC: libkern version of inet_ntoa_r

2012-07-29 Thread Luigi Rizzo
On Sun, Jul 29, 2012 at 03:38:59PM -0400, Arnaud Lacombe wrote: > Hi, > > On Sun, Jul 29, 2012 at 3:19 PM, Luigi Rizzo wrote: > > Remapping f(a) into f(a, b) requires both a macro > > and a wrapping function, something like this > > > > T __f(T1 a, T2 b) { return f(a, b); } > > #d

Re: RFC: libkern version of inet_ntoa_r

2012-07-29 Thread Arnaud Lacombe
Hi, On Sun, Jul 29, 2012 at 3:19 PM, Luigi Rizzo wrote: > Remapping f(a) into f(a, b) requires both a macro > and a wrapping function, something like this > > T __f(T1 a, T2 b) { return f(a, b); } > #define f(a) __f(a, b) > This can be done way more easily: void fn(int a, int b)

Re: RFC: libkern version of inet_ntoa_r

2012-07-29 Thread Luigi Rizzo
On Sun, Jul 29, 2012 at 05:55:19PM +0100, David Chisnall wrote: > On 29 Jul 2012, at 10:58, Luigi Rizzo wrote: > > > 3. nuke inet_ntoa_r() from libc > > inet_ntoa_r is a public symbol and therefore part of our ABI contract with > userspace applications. Even if no one that we are aware of is us

Re: RFC: libkern version of inet_ntoa_r

2012-07-29 Thread David Chisnall
On 29 Jul 2012, at 10:58, Luigi Rizzo wrote: > 3. nuke inet_ntoa_r() from libc inet_ntoa_r is a public symbol and therefore part of our ABI contract with userspace applications. Even if no one that we are aware of is using it, we should officially deprecate it for one major release before remo

Re: RFC: libkern version of inet_ntoa_r

2012-07-29 Thread Bjoern A. Zeeb
On Sun, 29 Jul 2012, Luigi Rizzo wrote: On Sat, Jul 28, 2012 at 10:14:10PM +, Bjoern A. Zeeb wrote: On Wed, 25 Jul 2012, Luigi Rizzo wrote: .. Given that libkern has inet_ntop, with the same arguments of the userspace version, we'd be much better off with the following course of action:

Re: RFC: libkern version of inet_ntoa_r

2012-07-29 Thread Luigi Rizzo
On Sat, Jul 28, 2012 at 10:14:10PM +, Bjoern A. Zeeb wrote: > On Wed, 25 Jul 2012, Luigi Rizzo wrote: > > >During some ipfw/dummynet cleanup i noticed that the libkern version of > >inet_ntoa_r() is missing the buffer size argument that is present in > >the libc counterpart. > > > >Any objecti

Re: RFC: libkern version of inet_ntoa_r

2012-07-28 Thread Arnaud Lacombe
Hi, On Sat, Jul 28, 2012 at 7:46 PM, Arnaud Lacombe wrote: > Hi, > > On Sat, Jul 28, 2012 at 6:44 PM, Bjoern A. Zeeb > wrote: >> Which again leaves me with the question - why does libc have it? >> > as for the semantic, theoretical, "why", I would refer you to the > POSIX's comity, as inet_ntop(

Re: RFC: libkern version of inet_ntoa_r

2012-07-28 Thread Arnaud Lacombe
Hi, On Sat, Jul 28, 2012 at 6:44 PM, Bjoern A. Zeeb wrote: > Which again leaves me with the question - why does libc have it? > as for the semantic, theoretical, "why", I would refer you to the POSIX's comity, as inet_ntop() is part of it. - Arnaud __

Re: RFC: libkern version of inet_ntoa_r

2012-07-28 Thread Arnaud Lacombe
Hi, On Sat, Jul 28, 2012 at 6:44 PM, Bjoern A. Zeeb wrote: > On Sat, 28 Jul 2012, Arnaud Lacombe wrote: > >> Hi, >> >> On Sat, Jul 28, 2012 at 6:14 PM, Bjoern A. Zeeb >> wrote: >>> >>> On Wed, 25 Jul 2012, Luigi Rizzo wrote: >>> During some ipfw/dummynet cleanup i noticed that the libkern v

Re: RFC: libkern version of inet_ntoa_r

2012-07-28 Thread Bjoern A. Zeeb
On Sat, 28 Jul 2012, Arnaud Lacombe wrote: Hi, On Sat, Jul 28, 2012 at 6:14 PM, Bjoern A. Zeeb wrote: On Wed, 25 Jul 2012, Luigi Rizzo wrote: During some ipfw/dummynet cleanup i noticed that the libkern version of inet_ntoa_r() is missing the buffer size argument that is present in the libc

Re: RFC: libkern version of inet_ntoa_r

2012-07-28 Thread Garrett Cooper
On Sat, Jul 28, 2012 at 3:35 PM, Arnaud Lacombe wrote: > Hi, > > On Sat, Jul 28, 2012 at 6:14 PM, Bjoern A. Zeeb > wrote: >> On Wed, 25 Jul 2012, Luigi Rizzo wrote: >> >>> During some ipfw/dummynet cleanup i noticed that the libkern version of >>> inet_ntoa_r() is missing the buffer size argument

Re: RFC: libkern version of inet_ntoa_r

2012-07-28 Thread Arnaud Lacombe
Hi, On Sat, Jul 28, 2012 at 6:14 PM, Bjoern A. Zeeb wrote: > On Wed, 25 Jul 2012, Luigi Rizzo wrote: > >> During some ipfw/dummynet cleanup i noticed that the libkern version of >> inet_ntoa_r() is missing the buffer size argument that is present in >> the libc counterpart. >> >> Any objection if

Re: RFC: libkern version of inet_ntoa_r

2012-07-28 Thread Bjoern A. Zeeb
On Wed, 25 Jul 2012, Luigi Rizzo wrote: During some ipfw/dummynet cleanup i noticed that the libkern version of inet_ntoa_r() is missing the buffer size argument that is present in the libc counterpart. Any objection if i fix it ? And why exactly would you need it? What does libc do with it?