[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ft-devel] sign in conversion INT_MIN and FT_Render_Glyph (Re: Freet
From: |
Roland Mainz |
Subject: |
Re: [ft-devel] sign in conversion INT_MIN and FT_Render_Glyph (Re: Freetype-devel Digest, Vol 121, Issue 4) |
Date: |
Fri, 13 Feb 2015 23:00:36 +0100 |
On Fri, Feb 13, 2015 at 10:57 PM, Hin-Tak Leung
<address@hidden> wrote:
> "possible" interesting and hidden bugs.
>
> I assume somewhere a 0x8000000
> is simply casted upwards, as in:
>
> signed int64 something_else = INT_MAX;
>
> and that's why it fails. Hmm, doing ((signed int) 0x80000000) doesn't really
> result in new compiler warnings in this case, though it would actually
> silently fix the problem.
>
> Yes, since include/limits.ht in mingw defines it; I overlooked - Visual studio
> does it too!
>
> C:/Program Files/Microsoft Visual Studio 8/VC/include/limits.h:#define
> INT_MIN (-2147483647 - 1) /* minimum (signed) int value */
> C:/Program Files/Microsoft Visual Studio 9.0/VC/include/limits.h:#define
> INT_MIN (-2147483647 - 1) /* minimum (signed) int value */
>
> I don't have anything more recent. But yes, re-defining constants
> in system headers is asking for trouble.
[snip]
What about defining some constants in the FT_* cpp "namespace", e.g.
|FT_INT_MIN| ?
----
Bye,
Roland
--
__ . . __
(o.\ \/ /.o) address@hidden
\__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer
/O /==\ O\ TEL +49 641 3992797
(;O/ \/ \O;)