Re: [ovs-dev] [threads 00/11] basic thread support library

2013-06-19 Thread Ed Maste
On 19 June 2013 17:54, Ben Pfaff  wrote:
> Oh, that's odd.  C11 appears to say that the parentheses are optional
> with _Atomic in this case (you can use _Atomic(...) as a type
> specifier or _Atomic by itself as a type qualifier) but I'll change it
> since that fixes the problem.

Ahh, it looks like _Atomic as a type qualifier is a recent addition to
clang: http://llvm.org/viewvc/llvm-project?view=revision&revision=178210
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [threads 00/11] basic thread support library

2013-06-19 Thread Ben Pfaff
On Wed, Jun 19, 2013 at 02:54:11PM -0700, Ben Pfaff wrote:
> On Wed, Jun 19, 2013 at 05:45:30PM -0400, Ed Maste wrote:
> > On 19 June 2013 17:22, Ben Pfaff  wrote:
> > > On Wed, Jun 19, 2013 at 05:20:11PM -0400, Ed Maste wrote:
> > >> On 19 June 2013 16:17, Ben Pfaff  wrote:
> > >> > This series has two purposes:
> > >> >
> > >> > * Add a basic thread support library to the tree.
> > >> >
> > >> > * Get rid of all calls to C library functions that POSIX describes
> > >> >   as inherently unsafe in a multithreaded program, and then add a
> > >> >   make-time check that flags an error if any calls get 
> > >> > reintroduced.
> > >>
> > >> This fails to build on FreeBSD for me, because it appears to rely on
> > >> header leakage for stdint.h types.
> > >>
> > >> In file included from lib/ovs-atomic.h:237,
> > >>  from lib/ovs-thread.h:23,
> > >>  from lib/command-line.c:22:
> > >> lib/ovs-atomic-c11.h:26: error: expected '=', ',', ';', 'asm' or
> > >> '__attribute__' before 'uint8_t'
> > >
> > > Does this mean that FreeBSD has ?  Is it fully
> > > functional?  That's the one implementation I wasn't able to test,
> > > because I didn't know of any C11 implementations with .
> > 
> > Indeed we do, and it should be functional.  SVN history is here if
> > you're interested:
> > http://svnweb.freebsd.org/base/head/sys/sys/stdatomic.h
> > 
> > That said, it seems it wasn't stdint.h per se that was the problem; I
> > needed to change:
> > 
> > -typedef _Atomic uint8_t   atomic_uint8_t;
> > +typedef _Atomic(uint8_t)   atomic_uint8_t;
> 
> Oh, that's odd.  C11 appears to say that the parentheses are optional
> with _Atomic in this case (you can use _Atomic(...) as a type
> specifier or _Atomic by itself as a type qualifier) but I'll change it
> since that fixes the problem.

I made that change in the latest version I pushed to the reviews repo.
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [threads 00/11] basic thread support library

2013-06-19 Thread Ben Pfaff
On Wed, Jun 19, 2013 at 05:45:30PM -0400, Ed Maste wrote:
> On 19 June 2013 17:22, Ben Pfaff  wrote:
> > On Wed, Jun 19, 2013 at 05:20:11PM -0400, Ed Maste wrote:
> >> On 19 June 2013 16:17, Ben Pfaff  wrote:
> >> > This series has two purposes:
> >> >
> >> > * Add a basic thread support library to the tree.
> >> >
> >> > * Get rid of all calls to C library functions that POSIX describes
> >> >   as inherently unsafe in a multithreaded program, and then add a
> >> >   make-time check that flags an error if any calls get reintroduced.
> >>
> >> This fails to build on FreeBSD for me, because it appears to rely on
> >> header leakage for stdint.h types.
> >>
> >> In file included from lib/ovs-atomic.h:237,
> >>  from lib/ovs-thread.h:23,
> >>  from lib/command-line.c:22:
> >> lib/ovs-atomic-c11.h:26: error: expected '=', ',', ';', 'asm' or
> >> '__attribute__' before 'uint8_t'
> >
> > Does this mean that FreeBSD has ?  Is it fully
> > functional?  That's the one implementation I wasn't able to test,
> > because I didn't know of any C11 implementations with .
> 
> Indeed we do, and it should be functional.  SVN history is here if
> you're interested:
> http://svnweb.freebsd.org/base/head/sys/sys/stdatomic.h
> 
> That said, it seems it wasn't stdint.h per se that was the problem; I
> needed to change:
> 
> -typedef _Atomic uint8_t   atomic_uint8_t;
> +typedef _Atomic(uint8_t)   atomic_uint8_t;

Oh, that's odd.  C11 appears to say that the parentheses are optional
with _Atomic in this case (you can use _Atomic(...) as a type
specifier or _Atomic by itself as a type qualifier) but I'll change it
since that fixes the problem.
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [threads 00/11] basic thread support library

2013-06-19 Thread Ed Maste
On 19 June 2013 17:22, Ben Pfaff  wrote:
> On Wed, Jun 19, 2013 at 05:20:11PM -0400, Ed Maste wrote:
>> On 19 June 2013 16:17, Ben Pfaff  wrote:
>> > This series has two purposes:
>> >
>> > * Add a basic thread support library to the tree.
>> >
>> > * Get rid of all calls to C library functions that POSIX describes
>> >   as inherently unsafe in a multithreaded program, and then add a
>> >   make-time check that flags an error if any calls get reintroduced.
>>
>> This fails to build on FreeBSD for me, because it appears to rely on
>> header leakage for stdint.h types.
>>
>> In file included from lib/ovs-atomic.h:237,
>>  from lib/ovs-thread.h:23,
>>  from lib/command-line.c:22:
>> lib/ovs-atomic-c11.h:26: error: expected '=', ',', ';', 'asm' or
>> '__attribute__' before 'uint8_t'
>
> Does this mean that FreeBSD has ?  Is it fully
> functional?  That's the one implementation I wasn't able to test,
> because I didn't know of any C11 implementations with .

Indeed we do, and it should be functional.  SVN history is here if
you're interested:
http://svnweb.freebsd.org/base/head/sys/sys/stdatomic.h

That said, it seems it wasn't stdint.h per se that was the problem; I
needed to change:

-typedef _Atomic uint8_t   atomic_uint8_t;
+typedef _Atomic(uint8_t)   atomic_uint8_t;

etc.
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [threads 00/11] basic thread support library

2013-06-19 Thread Ben Pfaff
On Wed, Jun 19, 2013 at 05:20:11PM -0400, Ed Maste wrote:
> On 19 June 2013 16:17, Ben Pfaff  wrote:
> > This series has two purposes:
> >
> > * Add a basic thread support library to the tree.
> >
> > * Get rid of all calls to C library functions that POSIX describes
> >   as inherently unsafe in a multithreaded program, and then add a
> >   make-time check that flags an error if any calls get reintroduced.
> 
> This fails to build on FreeBSD for me, because it appears to rely on
> header leakage for stdint.h types.
> 
> In file included from lib/ovs-atomic.h:237,
>  from lib/ovs-thread.h:23,
>  from lib/command-line.c:22:
> lib/ovs-atomic-c11.h:26: error: expected '=', ',', ';', 'asm' or
> '__attribute__' before 'uint8_t'

Does this mean that FreeBSD has ?  Is it fully
functional?  That's the one implementation I wasn't able to test,
because I didn't know of any C11 implementations with .
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [threads 00/11] basic thread support library

2013-06-19 Thread Ed Maste
On 19 June 2013 16:17, Ben Pfaff  wrote:
> This series has two purposes:
>
> * Add a basic thread support library to the tree.
>
> * Get rid of all calls to C library functions that POSIX describes
>   as inherently unsafe in a multithreaded program, and then add a
>   make-time check that flags an error if any calls get reintroduced.

This fails to build on FreeBSD for me, because it appears to rely on
header leakage for stdint.h types.

In file included from lib/ovs-atomic.h:237,
 from lib/ovs-thread.h:23,
 from lib/command-line.c:22:
lib/ovs-atomic-c11.h:26: error: expected '=', ',', ';', 'asm' or
'__attribute__' before 'uint8_t'
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev