[cairo] compiler warnings in cairo_wideint.h/c

Carl Worth cworth at cworth.org
Wed Oct 13 13:59:52 PDT 2004


On Wed, 13 Oct 2004 09:10:40 -0700, 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.

It would be nice to indicate that kind of information to the compiler.

But, according to C99, "const" is a "type qualifier" and as such
specifies properties that are "meaningful only for expressions that are
lvalues" §6.7.3 (3). Even more significant to the current code is:

	"If the specification of a function type includes any type
	 qualifiers, the behavior is undefined." §6.7.3 (8)

Bummer.

-Carl



More information about the cairo mailing list