freetype2/include/freetype/config
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
..
ftconfig.h * src/base/ftobjs.c (open_face_PS_from_sfnt_stream): Remove compiler 2008-10-04 11:39:03 +00:00
ftheader.h * autogen.sh, builds/unix/configure.raw, 2008-09-12 16:27:48 +00:00
ftmodule.h FT_USE_MODULE declares things as: 2008-12-21 10:29:30 +00:00
ftoption.h * devel/ftoption.h, include/freetype/config/ftoption.h 2008-11-05 14:34:29 +00:00
ftstdlib.h do not use functions from <ctypes.h>, they are locale-dependent (and slower) 2007-05-15 10:54:10 +00:00