Re: [Libusbx-devel] -Wcast-align warnings in public libusb.h

2012-10-16 Thread Sean McBride
On Mon, 15 Oct 2012 20:47:01 -0700, Orin Eman said: >There is also an argument for changing the buffer parameters to >libusb_fill_control_setup() and libusb_fill_control_transfer() to struct >libusb_control_setup *, but I'm just tossing that in for the record. Absolutely. The cast they are doing

Re: [Libusbx-devel] -Wcast-align warnings in public libusb.h

2012-10-16 Thread Sean McBride
On Mon, 15 Oct 2012 22:58:01 -0400, Pete Batard said: >On 15 October 2012 12:15, Sean McBride wrote: >>>3) Look at how other software that uses -Wcast-align handles the same issue. >> >> I'm not exactly sure what you're asking... > >I was suggesting that, before we do anything, we look at what pr

Re: [Libusbx-devel] -Wcast-align warnings in public libusb.h

2012-10-15 Thread Orin Eman
On Mon, Oct 15, 2012 at 7:58 PM, Pete Batard wrote: > On 15 October 2012 12:15, Sean McBride wrote: > >>3) Look at how other software that uses -Wcast-align handles the same > issue. > > > > I'm not exactly sure what you're asking... > > I was suggesting that, before we do anything, we look at w

Re: [Libusbx-devel] -Wcast-align warnings in public libusb.h

2012-10-15 Thread Pete Batard
On 15 October 2012 12:15, Sean McBride wrote: >>3) Look at how other software that uses -Wcast-align handles the same issue. > > I'm not exactly sure what you're asking... I was suggesting that, before we do anything, we look at what projects that: 1. Chose to use -Wcast-align 2. Ran into the war

Re: [Libusbx-devel] -Wcast-align warnings in public libusb.h

2012-10-15 Thread Sean McBride
On Mon, 15 Oct 2012 09:56:29 -0700, Orin Eman said: >> 1) making libusb_control_transfer_get_setup not inline, so it's iffy cast >> is hidden in a .c file >> > >That should wait for the next API break as it would change the binary >interface. By adding a new exported symbol you mean? Of course

Re: [Libusbx-devel] -Wcast-align warnings in public libusb.h

2012-10-15 Thread Orin Eman
On Mon, Oct 15, 2012 at 9:15 AM, Sean McBride wrote: > On Fri, 12 Oct 2012 23:25:14 +0100, Pete Batard said: > > >On 2012.10.12 22:06, Sean McBride wrote: > >> 3) ??? > > > >3) Look at how other software that uses -Wcast-align handles the same > issue. > > > >There's probably hardly any piece of

Re: [Libusbx-devel] -Wcast-align warnings in public libusb.h

2012-10-15 Thread Sean McBride
On Fri, 12 Oct 2012 23:25:14 +0100, Pete Batard said: >On 2012.10.12 22:06, Sean McBride wrote: >> 3) ??? > >3) Look at how other software that uses -Wcast-align handles the same issue. > >There's probably hardly any piece of significant C code out there that's >not going to cast a char* to str

Re: [Libusbx-devel] -Wcast-align warnings in public libusb.h

2012-10-12 Thread Pete Batard
On 2012.10.12 22:06, Sean McBride wrote: > 3) ??? 3) Look at how other software that uses -Wcast-align handles the same issue. There's probably hardly any piece of significant C code out there that's not going to cast a char* to struct*, so, if any has switched to using -Wcast-align, we might

[Libusbx-devel] -Wcast-align warnings in public libusb.h

2012-10-12 Thread Sean McBride
Hi all, When building my own code, where ever I #include libusbx (1.0.12), I get: libusb.h:1069:9: warning: cast from 'unsigned char *' to 'struct libusb_control_setup *' increases required alignment from 1 to 2 [-Wcast-align] libusb.h:1098:39: warning: cast from 'unsigned char *' to 'struct l