[Dune] [#674] strict-aliasing warnings with gcc-4.4

Dune dune at dune-project.org
Sat Dec 5 23:21:33 CET 2009


THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.

The following task has a new comment added:

FS#674 - strict-aliasing warnings with gcc-4.4
User who did this - Carsten Gräser (Carsten)

----------
The dilemma is that you can not avoid the cast for the meta grid if you don't want to store a HostIt and a seperate HostEPEntityPointer. There simply must be an EP that does not know about HostIt. Solution (b) would means:

1. Break compatibility with existing code.
2. If you want to write generic code you always have to create the temporary EP which means that any grid and not only GeometryGrid gets slower.

One solution could be to derive ItImp from EP<EPImp> and to require a method ItImp::getEntityPointer() that returns the EP<EpImp>&.

Then you could store the HostIt and the HostEP in the base class but only update the HostEP in this method. If you implement all methods directly in It using the HostIt this method is only called if you request an EP&. If this happens your approach (b) would create a temporary and thus be not more efficient.

The only drawback would be that the EP& does not change if you call It++ afterwards. However it would not be very restrictive to define the behaviour in this situation as undefined.

Regarding the cast: The only reason to keep it is to also provide the old grid implementers interface for one release.
----------

More information can be found at the following URL:
http://www.dune-project.org/flyspray/index.php?do=details&task_id=674#comment1463

You are receiving this message because you have requested it from the Flyspray bugtracking system.  If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.




More information about the Dune mailing list