Robert C. Seacord wrote: > this was only one of several solutions listed, and not the first one > listed.
Yes, CERT did the right thing by recommending first that the code be changed (kudos for that). >> What you really mean is, >> "Use an older GCC or some other compiler that is known not to >> take advantage of this optimization." > i think we mean what we say, which is "*Avoid newer versions of gcc" and > *"avoiding the use of gcc versions 4.2 and later." i don't see any > verbiage that says "use a different compiler". I hope you can understand why that particular phrasing would be viewed with some scorn, at least on the GCC list. Presumably, the intent really is to suggest using a compiler that doesn't have that optimization, not "don't use recent GCC versions". > our tests shows that the 2005 version of the compiler does not perform > this optimization. i have not yet tested a newer version of the compiler. There was a report (forwarded by Mark Mitchell) of Microsoft Visual C++ 2005 performing that optimization (the resultant object code was shown). Have you verified that this report was false? If not, it may be that you were using a different set of options or a different version of that compiler. -Jerry