Re: [Libusbx-devel] 3 warnings in git master from Xcode

2014-01-21 Thread Tim Roberts
Orin Eman wrote: > > Perhaps it's the comma Xcode doesn't like: {0,} and {0} would be OK. > (Assuming the comma in the original post wasn't a typo.) The trailing comma is specifically allowed by the specs. I love this language lawyer stuff, and I apologize for starting this diversion here... --

Re: [Libusbx-devel] 3 warnings in git master from Xcode

2014-01-21 Thread Tim Roberts
Tim Roberts wrote: > Nathan Hjelm wrote: >> >> Ah. Ok. Wasn't aware of that case. The code is question is ISO C89 to >> support MSVC. Do you know if the C89 standard also guarantees the rest >> of the struct is zeroed? > Yes. That C99 wording was copied from the C89 spec, section 3.5.7. HAVING

Re: [Libusbx-devel] 3 warnings in git master from Xcode

2014-01-21 Thread Orin Eman
I've not met an MSVC compiler that hasn't implemented {0} correctly. Perhaps it's the comma Xcode doesn't like: {0,} and {0} would be OK. (Assuming the comma in the original post wasn't a typo.) I haven't compiled libusb(x) on the Mac since I got forced into installing Xcode 5... I'll give it a

Re: [Libusbx-devel] 3 warnings in git master from Xcode

2014-01-21 Thread Pete Batard
On 2014.01.21 18:06, Sean McBride wrote: > just merge my 2 character change please. :) Done for libusbx. Will do the same for libusb later. Regards, /Pete -- CenturyLink Cloud: The Leader in Enterprise Cloud Services.

Re: [Libusbx-devel] 3 warnings in git master from Xcode

2014-01-21 Thread Sean McBride
On Tue, 21 Jan 2014 09:59:49 -0800, Orin Eman said: >I've not met an MSVC compiler that hasn't implemented {0} correctly. > >Perhaps it's the comma Xcode doesn't like: {0,} and {0} would be OK. > (Assuming the comma in the original post wasn't a typo.) No, the warning applies in both cases. Guys

Re: [Libusbx-devel] 3 warnings in git master from Xcode

2014-01-21 Thread Tim Roberts
Nathan Hjelm wrote: > > > Ah. Ok. Wasn't aware of that case. The code is question is ISO C89 to > support MSVC. Do you know if the C89 standard also guarantees the rest > of the struct is zeroed? Yes. That C99 wording was copied from the C89 spec, section 3.5.7. -- Tim Roberts, t...@probo.com

Re: [Libusbx-devel] 3 warnings in git master from Xcode

2014-01-21 Thread Nathan Hjelm
On Jan 21, 2014, at 10:30 AM, Tim Roberts wrote:Nathan Hjelm wrote:On Jan 20, 2014, at 4:56 PM, Tim Roberts wrote: Even if there isn't, the standard guarantees that those two constructs are identical. Any elements that don't have initializer values get zeroed. Not quite. This is true for global

Re: [Libusbx-devel] 3 warnings in git master from Xcode

2014-01-21 Thread Tim Roberts
Nathan Hjelm wrote: > On Jan 20, 2014, at 4:56 PM, Tim Roberts wrote: > >> Even if there isn't, the standard guarantees that those two constructs >> are identical. Any elements that don't have initializer values get zeroed. > Not quite. This is true for global/static variables. Anything allocated

Re: [Libusbx-devel] 3 warnings in git master from Xcode

2014-01-21 Thread Sean McBride
On Tue, 21 Jan 2014 07:43:10 -0700, Nathan Hjelm said: >Nope. struct timeval is POSIX (http://pubs.opengroup.org/onlinepubs/ >759899/basedefs/sys/time.h.html) and always has exactly 2 members. OK, can someone merge this then:

Re: [Libusbx-devel] 3 warnings in git master from Xcode

2014-01-21 Thread Nathan Hjelm
On Jan 20, 2014, at 11:59 AM, Sean McBride wrote: > Hi all, > > With 1.0.18 coming, I though I'd try building git master with the latest > Xcode. I see 3 warnings: > > (1) core.c:1910:27: Missing field 'tv_usec' initializer > > can we just change: > struct timeval tv = { 0, }; > to: >

[Libusbx-devel] libusbx bug in handle_bulk_completion - wrong pointer computations

2014-01-21 Thread Erik Rull
Hi all, getting a tpriv->urbs NULL pointer causes negative urb_idx and successively an undefined behavior! This happens when removing a USB device during a transfer with a chance of ~ 20%. With the small extension the error can be made visible: static int handle_bulk_completion(struct usbi_trans