On Mon, 15 Oct 2012 22:58:01 -0400, Pete Batard said:

>On 15 October 2012 12:15, Sean McBride <s...@rogue-research.com> 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 warning above
>chose to do to see if there is a trend and try to get some additional ideas.

Well, I tried, but that's pretty open ended.  And how to fix code really 
depends on the code of course.

>Well, it's the "how" part of "fixing their code" I'm interested in.

Well, not to be flippant, but the 'how' is: don't cast a foo* to a bar*.  It's 
invalid.  Despite people thinking of C as high level assembly, it is not.

Perhaps turn the question around: why does libusbx think a pointer to a 
structure and a pointer to a character are interchangeable?

In any case, fixing this meaningfully should probably be in 2.0, but a 
conservative fix in 1.x would be nice.  Other than the options discussed, 
another is to wrap offending code in libusb.h in:

#pragma gcc diagnostic push
#pragma gcc diagnostic ignored "-Wcast-align"

#pragma gcc diagnostic pop

Perhaps that is best?

Cheers,

-- 
____________________________________________________________
Sean McBride, B. Eng                 s...@rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada



------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel

Reply via email to