[Dune] [#674] strict-aliasing warnings with gcc-4.4
Dune
dune at dune-project.org
Sat Dec 5 15:42:07 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)
----------
As Christian said we have discussed the options. Regarding Martins options:
(a) is obviously not an option and (b) as well. It will break at lot of code if EntityPointers& ep=it is not supported. And allowing the temporary object needed if iterators are passed as function arguments is neither clean nor intuitive. I don't really understand what you mean with (c).
Our main idea is to derive ItImp from EP<EPImp> instead of EPImp. Then we could savely return the reference to the base class of ItImp.
The clean solution would then by to abolish the strange EP<ItImp> and to make ItImp a member of It. Notice that this will not change the memory layout of any class.
I also have a small patch to EntityPointer with a quick solution for a transition. It returns
(1) EP<Imp> if Imp=EPImp
(2) EP<Imp>::realIterator if Imp is derived from EP<EpImp>
(3) reinterpret_cast<EP<EpImp>&>(EP<Imp>) else
For the current grids this is the same as before: (1) or (3). For all adapted grids with ItImp deriving from EP<EPImp> this selects (1) or (2) and thus is a clean solution. This allowes for a smooth transition iterator per iterator. I have tested this with a quick for the UGLevelIterator.
We also suggests to have additional new interface classes which could be selected (by the GridTraits) for all grids that completely implement the new behaviour.
Since this only adjusts the inheritance hierarchy and does not introduce any additional members, copies or creation of temporaries there is no performance problem with this.
----------
More information can be found at the following URL:
http://www.dune-project.org/flyspray/index.php?do=details&task_id=674#comment1459
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