Re: [Algorithms] How to get 3dvector largest coordinate index?
Brought to you by:
vexxed72
From: Charles N. <cha...@gm...> - 2009-03-05 19:08:11
|
On Thu, Mar 5, 2009 at 10:37 AM, <chr...@pl...>wrote: > Matt J wrote: > > [...] Finally, even CERT thinks its okay: > > > > https://www.securecoding.cert. > > > > org/confluence/download/attachments/26017980/SD+West+Dangerous+Optimizations. > > > pdf?version=1 > > > > See page 75. Which was written in 2009. > > You are confused. They are talking about gcc only, as made clear by the > reference to "-fstrict-aliasing" smack in the middle of that slide. It looks to me like the CERT paper cited specifically refers to C99 (on gcc, as Christer mentioned). Matt, you made the point that gcc applies the TSAA/strict-aliasing rules when running in C++ mode as well, but I think that's even more evidence that this really is compiler-specific stuff here, and that it's important to be aware + tread carefully when you move to a new environment (gcc -> llvm, for a hypothetical example, given how much apple is investing in llvm infrastructure these days). Ultimately I think it matters most that you're very aware of when and where you violate the standard, and make sure you test your violations on every platform you're compiling on, with all your optimizations turned on. If you can wrap it up in a macro/function that you know works on all of your platforms/compilers, so much the better. -charles |