[Libvir] [PATCH] libvirt.c: warning: dereferencing type-punned pointer will break strict-aliasing rules

Richard W.M. Jones rjones at redhat.com
Wed Mar 7 09:52:41 UTC 2007


Daniel P. Berrange wrote:
> Looking at the code, IMHO, the whole approach of iterating over the driver
> table soo many times is just wrong, when we can simply have an integer
> count recording how many drivers are registered. This eliminates both
> for(;;) loops, and reduces the amount of code to the point where I don't
> think there's anything to be gained by having a generic _virDriverRegister
> with all the type-casting this entails.

A kind of "Shlemiel the painter"[1] problem?

> So how about the attached patch instead....

I think that looks better.

Rich.

[1] http://www.joelonsoftware.com/articles/fog0000000319.html

-- 
Emerging Technologies, Red Hat  http://et.redhat.com/~rjones/
64 Baker Street, London, W1U 7DF     Mobile: +44 7866 314 421
  "[Negative numbers] darken the very whole doctrines of the equations
  and make dark of the things which are in their nature excessively
  obvious and simple" (Francis Maseres FRS, mathematician, 1759)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3237 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20070307/a5181a7e/attachment-0001.bin>


More information about the libvir-list mailing list