Afficher un message
Vieux 14/04/2008, 11h35   #10
Ian Collins
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: #define for very small numbers ?

Richard Tobin wrote:
> In article <66gdk8F2kg6m6U9@mid.individual.net>,
> Ian Collins <ian-news@hotmail.com> wrote:
>
>>> A definite point. However, what use is a stored const? Accessing
>>> it requires loading an address and then dereferencing. A compile
>>> time constant just requires loading the value.

>
>> Which is what any self respecting optimiser will do with a constant.

>
> But C's const variables are not constants. Do the guarantees that
> const makes actually allow the compiler to assume the variable's
> value in a situation like this?


They may not be compile time constants, but they are "read only", so the
compiler is safe to assume their value will not change.

--
Ian Collins.
  Réponse avec citation
 
Page generated in 0,04465 seconds with 9 queries