freetype2/src
Werner Lemberg ce33a312da FT_USE_MODULE declares things as:
extern const FT_Module_Class

(or similar for C++).  However, the actual types of the variables
being declared are often different, e.g., FT_Driver_ClassRec or
FT_Renderer_Class.  (Some are, indeed, FT_Module_Class.)

This works with most C compilers (since those structs begin with an
FT_Module_Class struct), but technically it's undefined behavior.

To quote the ISO/IEC 9899:TC2 final committee draft, section 6.2.7
paragraph 2:

  All declarations that refer to the same object or function shall
  have compatible type; otherwise, the behavior is undefined.

(And they are not compatible types.)

Most C compilers don't reject (or even detect!) code which has this
issue, but the GCC LTO development branch compiler does.  (It
outputs the types of the objects while generating .o files, along
with a bunch of other information, then compares them when doing the
final link-time code generation pass.)

Patch from Savannah bug #25133.

* src/base/ftinit.c (FT_USE_MODULE): Include variable type.

* builds/amiga/include/freetype/config/ftmodule.h,
include/freetype/config/ftmodule.h, */module.mk: Updated to declare
pass correct types to FT_USE_MODULE.
2008-12-21 10:29:30 +00:00
..
autofit FT_USE_MODULE declares things as: 2008-12-21 10:29:30 +00:00
base FT_USE_MODULE declares things as: 2008-12-21 10:29:30 +00:00
bdf FT_USE_MODULE declares things as: 2008-12-21 10:29:30 +00:00
cache * builds/freetype.mk (BASE_H): Rename to... 2008-10-02 06:48:10 +00:00
cff FT_USE_MODULE declares things as: 2008-12-21 10:29:30 +00:00
cid FT_USE_MODULE declares things as: 2008-12-21 10:29:30 +00:00
gxvalid FT_USE_MODULE declares things as: 2008-12-21 10:29:30 +00:00
gzip Make braces balanced throught the whole file. 2008-10-07 18:15:46 +00:00
lzw Cosmetic code changes. 2008-05-28 22:17:28 +00:00
otvalid FT_USE_MODULE declares things as: 2008-12-21 10:29:30 +00:00
pcf FT_USE_MODULE declares things as: 2008-12-21 10:29:30 +00:00
pfr FT_USE_MODULE declares things as: 2008-12-21 10:29:30 +00:00
psaux FT_USE_MODULE declares things as: 2008-12-21 10:29:30 +00:00
pshinter FT_USE_MODULE declares things as: 2008-12-21 10:29:30 +00:00
psnames FT_USE_MODULE declares things as: 2008-12-21 10:29:30 +00:00
raster FT_USE_MODULE declares things as: 2008-12-21 10:29:30 +00:00
sfnt FT_USE_MODULE declares things as: 2008-12-21 10:29:30 +00:00
smooth FT_USE_MODULE declares things as: 2008-12-21 10:29:30 +00:00
tools * include/freetype/freetype.h (FT_LOAD_ADVANCE_ONLY): Use value 2008-12-05 18:37:44 +00:00
truetype FT_USE_MODULE declares things as: 2008-12-21 10:29:30 +00:00
type1 FT_USE_MODULE declares things as: 2008-12-21 10:29:30 +00:00
type42 FT_USE_MODULE declares things as: 2008-12-21 10:29:30 +00:00
winfonts FT_USE_MODULE declares things as: 2008-12-21 10:29:30 +00:00
Jamfile Add license. 2005-06-04 23:04:30 +00:00