On 3/12/2010 10:50 AM, Hyrum K. Wright wrote: > > On Mar 12, 2010, at 10:39 AM, William A. Rowe Jr. wrote: > >> On 3/12/2010 5:21 AM, Greg Stein wrote: >>> >>> It is *totally* fine to add a 'const' to a parameter that was not >>> there before. That does not change the ABI whatsoever, and it will not >>> break the API for callers. It merely gives them more information at >>> compile time. >> >> int oldfunc (const char *result); >> >> int brokefunc () >> { >> char *res = oldfunc(); >> } >> >> doesn't compile on a single platform I know of. >> >> Your statement makes no sense; how does adding const'ness to char *result >> not come with source code level compatibility breakage? > > I think he means it was the 'const' which was not previously present, not the > parameter itself.
That is my understanding too. In this example, int oldfunc(char *result) is transformed through the addition of a const. And the claim still makes no sense, for the reasons that I point out above :)