[cairo] compiler warnings in cairo_wideint.h/c

Andreas Tobler toa at pop.agri.ch
Wed Oct 13 13:38:04 PDT 2004


Keith Packard wrote:

> Around 8 o'clock on Oct 13, "Andreas Tobler" wrote:
> 
> 
>>/* Type qualifiers on a function return type are
>>   normally permitted by the standard but have no
>>   effect.
>>*/
> 
> 
> Hmm.  The effect I was trying to induce was to teach the compiler that 
> given fixed arguments, these functions always return the same result 
> (i.e., they are "pure" functions).  I thought that's what the 'const' 
> qualifier on the return value did.

Not quite, the const has only a meaning in terms of compile time issue.
e.g, you can say 'const int a = 10;' Then the compiler assigns 'a' a ten 
(value 10).
At runtime the const has no influence. Only if someone outside your 
program/application is modifying the 'a'. (e.g) a hw issue.

Your program/application can not modify const's.
And a function is meant to be modifying at runtime.

This is my understanding of using const.

If I'm wrong, please tell me.

Maybe, you may get something out of using 'static'.

Andreas



More information about the cairo mailing list