%% [EMAIL PROTECTED] writes:

  >> This restriction (or, lack of ability to assume) only takes effect
  >> when stepping across function calls, doesn't it?

  r> And into.  Any function that takes a pointer can't be sure it's not
  r> aliased.

Yes, that's what I meant--probably expressed badly.  What I meant to say
was, from the compiler optimizer's point of view, I think that const
vars can be optimized within a function _until_ another function is
invoked, even if that function doesn't take the var as an argument
(because of aliasing, as you point out).

So, I think const _can_ result in performance increases--just maybe not
as many as one might think initially.

But, the main reason I constify is as a form of interface documentation.
If I have to play a few tricks with casts to get the API correct when
adding const, it's a price I'm willing to pay to make the API more
transparent.

YMMV.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <[EMAIL PROTECTED]>    HASMAT--HA Software Methods & Tools
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
-------------------------------------------------------------------------------
   These are my opinions---Nortel Networks takes no responsibility for them.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to