freetype-devel
[Top][All Lists]
Advanced

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

Re: [ft-devel] compiling FreeType with C++


From: Behdad Esfahbod
Subject: Re: [ft-devel] compiling FreeType with C++
Date: Sat, 25 Feb 2006 07:42:43 -0500 (EST)

On Sat, 25 Feb 2006, Werner LEMBERG wrote:

> David,
>
>
> please fix compilation with a C++ compiler!  For example, `make devel
> CC=g++' fails currently.  Otherwise we get zillions of bug reports
> from Nelson Beebe :-)
>
> If there isn't an easy fix there should be a snippet in the configure
> script (or directly in the Makefiles) which activates the proper
> configuration macros.

Patch attached.  It also fixes a bunch of warnings/errors not
related to C++.  The highlights:

  * For C++, it seems like undefining FT_STRICT_ALIASING makes
most of the errors go away, and with FT_STRICT_ALIASING, I
couldn't find any (easy) way to make it go.

  * The rest of C++ errors were missing casts (of ints to enums
or the other way..., geez.)


With gcc, I have a lot of warning options enabled, the most
important here was -Wmissing-prototypes, which reveals functions
that should be static but are not, or missing header includes.
So:

  * A bunch of missing includes fixed.

  * src/sfnt/ttbdf.c seems to have \r\n line endings.  The change
I have made there was because of the goto statement, g++ was
erring that the variables may not be initialized...  So I made
them assignments instead of initialization, fixed that.

  * In src/smooth/ftgrays.c, there was an extern function that I
made it static to go with the rest of the functions in that file,
but I think they all should be changed to FT_Callback.



That was basically it.  I'm not quite convinced that
FT_STRICT_ALIASING is needed.  David, were you getting new
warnings with gcc 4.1?  Cause I fxied all strict-aliasing
warnings on gcc 4.0 previously.

--behdad
http://behdad.org/

"Commandment Three says Do Not Kill, Amendment Two says Blood Will Spill"
        -- Dan Bern, "New American Language"

Attachment: freetype2-warning-cleanup2.patch
Description: Text document


reply via email to

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