Bug 24995 - CAIRO_FORMAT_VALID failed to work with Sun Studio C compiler
Summary: CAIRO_FORMAT_VALID failed to work with Sun Studio C compiler
Alias: None
Product: cairo
Classification: Unclassified
Component: general (show other bugs)
Version: 1.9.3
Hardware: Other All
: medium major
Assignee: Carl Worth
QA Contact: cairo-bugs mailing list
Depends on:
Blocks: cairo-1.10
  Show dependency treegraph
Reported: 2009-11-09 03:10 UTC by Ginn Chen
Modified: 2010-02-28 15:59 UTC (History)
0 users

See Also:
i915 platform:
i915 features:

test (552 bytes, text/plain)
2009-11-09 03:10 UTC, Ginn Chen
patch (574 bytes, patch)
2009-11-09 03:12 UTC, Ginn Chen
Details | Splinter Review

Description Ginn Chen 2009-11-09 03:10:01 UTC
Created attachment 31059 [details]

Test program attached.

ginn@opensolaris:~$ cc cairotest.c 
"cairotest.c", line 18: warning: initializer does not fit or is out of range: 0xffffffff
ginn@opensolaris:~$ ./a.out 
valid? 1
ginn@opensolaris:~$ gcc-4.3.2 cairotest.c 
ginn@opensolaris:~$ ./a.out 
valid? 0

I'm not sure if the behavior is implement dependent.
I think it would be safer if we use 0x7fffffff for CAIRO_FORMAT_INVALID or case it to unsigned it in CAIRO_FORMAT_VALID.
Comment 1 Ginn Chen 2009-11-09 03:12:14 UTC
Created attachment 31060 [details] [review]

This bug is causing crashes of Firefox 3.6/3.7 on xBGR frame buffer.
See https://bugzilla.mozilla.org/show_bug.cgi?id=526976
Comment 2 Ginn Chen 2010-01-12 23:21:36 UTC
I understood you are considering change the value of CAIRO_FORMAT_INVALID.

Please at least take the workaround for 1.10.
Comment 3 M Joonas Pihlaja 2010-01-13 00:30:34 UTC
Okay, things are moving again!  Apologies for playing the dead brick part for the last good while.  We want to expose the invalid value explicitly in the enum so that the enum type isn't abused so hard in the code.  This ought to be an ABI compatible change AFAICT, since Sun's cc is telling me that sizeof() the type won't change, and anyway we're only passing the format to/from the client via formal arguments or as a return value.
Comment 4 M Joonas Pihlaja 2010-02-28 15:59:46 UTC
This should now be fixed in git master.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.