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

2014-03-21 Thread Nathan Hjelm
On Mar 21, 2014, at 12:50 PM, Sean McBride wrote:On Fri, 21 Mar 2014 18:44:01 +, Nathan Hjelm said:        >I can't get scan-build to give me the the first oneIt's a compiler warning, not a static analyzer warning. I get it just building with Xcode 5.0.2. Again, I think last line of the functi

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

2014-03-21 Thread Sean McBride
On Fri, 21 Mar 2014 18:44:01 +, Nathan Hjelm said: >I can't get scan-build to give me the the first one It's a compiler warning, not a static analyzer warning. I get it just building with Xcode 5.0.2. Again, I think last line of the function is returning entirely the wrong thing. Shouldn

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

2014-03-21 Thread Nathan Hjelm
On Mar 21, 2014, at 12:44 PM, Nathan Hjelm wrote:On Mar 21, 2014, at 11:49 AM, Sean McBride wrote:On Tue, 21 Jan 2014 07:43:10 -0700, Nathan Hjelm said:        >        > (2) os/darwin_usb.c:531:10: Implicit conversion loses integer        >precision: 'size_t' (aka 'unsigned long') to 'int'      

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

2014-03-21 Thread Nathan Hjelm
On Mar 21, 2014, at 11:49 AM, Sean McBride wrote:On Tue, 21 Jan 2014 07:43:10 -0700, Nathan Hjelm said:        >        > (2) os/darwin_usb.c:531:10: Implicit conversion loses integer        >precision: 'size_t' (aka 'unsigned long') to 'int'        >        >        >        > A cast would silen

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

2014-03-21 Thread Sean McBride
On Tue, 21 Jan 2014 07:43:10 -0700, Nathan Hjelm said: >> (2) os/darwin_usb.c:531:10: Implicit conversion loses integer >precision: 'size_t' (aka 'unsigned long') to 'int' >> >> A cast would silence this, but actually I worry the last line of the >function is returning entirely the wrong thing.

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: >

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

2014-01-20 Thread Nathan Hjelm
> On Jan 20, 2014, at 4:56 PM, Tim Roberts wrote: > > Sean McBride wrote: >> 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 =

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

2014-01-20 Thread Tim Roberts
Sean McBride wrote: > 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: > struct timeval tv = { 0, 0 }; > > is ther

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

2014-01-20 Thread Sean McBride
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: struct timeval tv = { 0, 0 }; is there any platform where this