[Development] cast ... increases required alignment of target type [-Werror=cast-align]

Thiago Macieira thiago.macieira at intel.com
Wed Mar 7 17:12:04 CET 2012


On quarta-feira, 7 de março de 2012 19.36.17, Rohan McGovern wrote:
> Thanks, so can we use #pragma GCC diagnostic to selectively silence
> warnings like this?  There doesn't seem to be much precedent for it so
> far (just one usage I can find in qatomic.h).

We can do that to silence the warning.

However, the proper solution is to redesign the function in question so that 
the bad code never appears on it. The STL solution for this is to use tag 
types and indirect via another function call.

João knows all about this and he had a plan to implement this cleaner code at 
one point.

That's why we need static_if in C++2x :-)

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
     Intel Sweden AB - Registration Number: 556189-6027
     Knarrarnäsgatan 15, 164 40 Kista, Stockholm, Sweden
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20120307/1de579e0/attachment.sig>


More information about the Development mailing list