diff options
author | Werner Lemberg <wl@gnu.org> | 2008-12-21 10:29:30 +0000 |
---|---|---|
committer | Werner Lemberg <wl@gnu.org> | 2008-12-21 10:29:30 +0000 |
commit | ce33a312daca1944e61a11c4e7522d37f4da4f4d (patch) | |
tree | 6718615bc35449a73f471285d4ee3596b057ce8a /builds/amiga | |
parent | b6fa8451461b51cc793a4cd0ab17350e3e6ae9fe (diff) | |
download | freetype2-ce33a312daca1944e61a11c4e7522d37f4da4f4d.tar.gz |
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.
Diffstat (limited to 'builds/amiga')
-rw-r--r-- | builds/amiga/include/freetype/config/ftmodule.h | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/builds/amiga/include/freetype/config/ftmodule.h b/builds/amiga/include/freetype/config/ftmodule.h index c8a5bee22..5873bab74 100644 --- a/builds/amiga/include/freetype/config/ftmodule.h +++ b/builds/amiga/include/freetype/config/ftmodule.h @@ -80,77 +80,77 @@ /* Now include the modules */ #ifdef FT_USE_AUTOFIT -FT_USE_MODULE(autofit_module_class) +FT_USE_MODULE( FT_Module_Class, autofit_module_class ) #endif #ifdef FT_USE_TT -FT_USE_MODULE(tt_driver_class) +FT_USE_MODULE( FT_Driver_ClassRec, tt_driver_class ) #endif #ifdef FT_USE_T1 -FT_USE_MODULE(t1_driver_class) +FT_USE_MODULE( FT_Driver_ClassRec, t1_driver_class ) #endif #ifdef FT_USE_CFF -FT_USE_MODULE(cff_driver_class) +FT_USE_MODULE( FT_Driver_ClassRec, cff_driver_class ) #endif #ifdef FT_USE_T1CID -FT_USE_MODULE(t1cid_driver_class) +FT_USE_MODULE( FT_Driver_ClassRec, t1cid_driver_class ) #endif #ifdef FT_USE_PFR -FT_USE_MODULE(pfr_driver_class) +FT_USE_MODULE( FT_Driver_ClassRec, pfr_driver_class ) #endif #ifdef FT_USE_T42 -FT_USE_MODULE(t42_driver_class) +FT_USE_MODULE( FT_Driver_ClassRec, t42_driver_class ) #endif #ifdef FT_USE_WINFNT -FT_USE_MODULE(winfnt_driver_class) +FT_USE_MODULE( FT_Driver_ClassRec, winfnt_driver_class ) #endif #ifdef FT_USE_PCF -FT_USE_MODULE(pcf_driver_class) +FT_USE_MODULE( FT_Driver_ClassRec, pcf_driver_class ) #endif #ifdef FT_USE_PSAUX -FT_USE_MODULE(psaux_module_class) +FT_USE_MODULE( FT_Module_Class, psaux_module_class ) #endif #ifdef FT_USE_PSNAMES -FT_USE_MODULE(psnames_module_class) +FT_USE_MODULE( FT_Module_Class, psnames_module_class ) #endif #ifdef FT_USE_PSHINT -FT_USE_MODULE(pshinter_module_class) +FT_USE_MODULE( FT_Module_Class, pshinter_module_class ) #endif #ifdef FT_USE_RASTER -FT_USE_MODULE(ft_raster1_renderer_class) +FT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class ) #endif #ifdef FT_USE_SFNT -FT_USE_MODULE(sfnt_module_class) +FT_USE_MODULE( FT_Module_Class, sfnt_module_class ) #endif #ifdef FT_USE_SMOOTH -FT_USE_MODULE(ft_smooth_renderer_class) -FT_USE_MODULE(ft_smooth_lcd_renderer_class) -FT_USE_MODULE(ft_smooth_lcdv_renderer_class) +FT_USE_MODULE( FT_Renderer_Class, ft_smooth_renderer_class ) +FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcd_renderer_class ) +FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcdv_renderer_class ) #endif #ifdef FT_USE_OTV -FT_USE_MODULE(otv_module_class) +FT_USE_MODULE( FT_Module_Class, otv_module_class ) #endif #ifdef FT_USE_BDF -FT_USE_MODULE(bdf_driver_class) +FT_USE_MODULE( FT_Driver_ClassRec, bdf_driver_class ) #endif #ifdef FT_USE_GXV -FT_USE_MODULE(gxv_module_class) +FT_USE_MODULE( FT_Module_Class, gxv_module_class ) #endif /* |