freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ft-devel] patch to use of enums in ft2demos


From: Steve Langasek
Subject: [ft-devel] patch to use of enums in ft2demos
Date: Fri, 27 Aug 2010 19:24:50 -0700
User-agent: Mutt/1.5.20 (2009-06-14)

Hi all,

GCC 4.5 emits a new warning when an enum type is compared to a numeric
constant whose value isn't included in that enum.  Since there's a bit of
that going on in ft2demos, this results in a build failure with -Werror,
with errors such as the following:

gcc-4.5 [...] -Werror [...] src/ftdiff.c
cc1: warnings being treated as errors
/home/devel/freetype/freetype-2.4.2/ft2demos-2.4.2/src/ftdiff.c: In function 
'process_event':
/home/devel/freetype/freetype-2.4.2/ft2demos-2.4.2/src/ftdiff.c:1074:5: error: 
case value '43' not in enumerated type 'grKey'
/home/devel/freetype/freetype-2.4.2/ft2demos-2.4.2/src/ftdiff.c:1067:5: error: 
case value '45' not in enumerated type 'grKey'
/home/devel/freetype/freetype-2.4.2/ft2demos-2.4.2/src/ftdiff.c:943:5: error: 
case value '49' not in enumerated type 'grKey'

There are two possible ways to address this:  we can extend the enum to have
a full list of the values we care about, or we can avoid defining variables
to use the enum type when that's not actually how it's being used.  I think
the latter solution makes more sense here, but I have no strong opinion, so
I've attached a patch for each option.

Cheers,
-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
address@hidden                                     address@hidden

Attachment: 0001-Don-t-use-an-enum-if-we-re-not-going-to-enumerate.patch
Description: Text Data

Attachment: 0001-Make-grKey-enum-comprehensive-for-gcc-4.5-compatibil.patch
Description: Text Data

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]