[openssl-dev] Under-utilization of "const" in prototyping?

Kurt Roeckx kurt at roeckx.be
Fri Dec 5 12:24:02 EST 2014


On Fri, Dec 05, 2014 at 05:15:24PM +0000, Viktor Dukhovni wrote:
> On Fri, Dec 05, 2014 at 05:07:04PM +0100, Kurt Roeckx wrote:
> 
> > On Fri, Dec 05, 2014 at 10:40:07AM -0500, Daniel Kahn Gillmor wrote:
> > > (of course it would probably end up modifying some public
> > > interfaces, so it would need to take effect publicly during an API change).
> > 
> > Adding const to a function shouldn't be a problem for C.  It would
> > be for C++.
> 
> Actually, it can be a problem with C also.  Replacing "char **" in
> a function prototype with "const char **" changes the API.

This is actually in the C FAQ:
http://c-faq.com/ansi/constmismatch.html


Kurt



More information about the openssl-dev mailing list