[cairo] [PATCH 5/6] cairo-script: Error if asked to decompress with missing compression lib

Bryce W. Harrington b.harrington at samsung.com
Thu Jan 30 23:34:23 PST 2014

On Thu, Jan 30, 2014 at 10:32:39AM +0000, Chris Wilson wrote:
> On Thu, Jan 30, 2014 at 02:14:14AM +0000, Bryce W. Harrington wrote:
> > This quells the following warning:
> > 
> > warning: enumeration value ‘LZO’ not handled in switch [-Wswitch-enum]
> > 
> > The LZO enum value is defined and used elsewhere, even if lzo support
> > isn't available.
> > 
> > This situation might arise if cairo scripts were generated on one system
> > with lzo, and then replayed on a system without it.  For now simply
> > error out if this occurs.
> Right, I thought these currently fell into the default: case?
> -Chris

It does; it looks like this is -Wswitch-enum being pedantic.  The
warning is worthwhile to leave on, as it should help us catch cases
where someone adds a new enum definition but omits handling it in
appropriate switch statements.

For this particular patch, in one of the defaults the action is to send
an "Out of Memory" error, which isn't quite accurate anyway.  So I think
this patch does improve things, even if it's only a theoretical problem.


More information about the cairo mailing list