Re: [ovs-dev] [PATCH 1/2] cmap, classifier: Avoid unsafe aliasing in iterators.

2014-07-21 Thread Ben Pfaff
On Mon, Jul 21, 2014 at 03:25:58PM -0700, Jarno Rajahalme wrote: > As you noted earlier, CMAP_FOR_EACH and CMAP_FOR_EACH_SAFE now are > basically the same thing, the only difference being on that safe does > the advance before calling the body. You considered merging them > before? Sure. Here's a

Re: [ovs-dev] [PATCH 1/2] cmap, classifier: Avoid unsafe aliasing in iterators.

2014-07-21 Thread Jarno Rajahalme
As you noted earlier, CMAP_FOR_EACH and CMAP_FOR_EACH_SAFE now are basically the same thing, the only difference being on that safe does the advance before calling the body. You considered merging them before? Acked-by: Jarno Rajahalme On Jul 19, 2014, at 10:28 AM, Ben Pfaff wrote: > CMAP_FO

[ovs-dev] [PATCH 1/2] cmap, classifier: Avoid unsafe aliasing in iterators.

2014-07-19 Thread Ben Pfaff
CMAP_FOR_EACH and CLS_FOR_EACH and their variants tried to use void ** as a "pointer to any kind of pointer". That is a violation of the aliasing rules in ISO C which technically yields undefined behavior. With GCC 4.1, it causes both warnings and actual misbehavior. One option would to add -fno