[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [ft-devel] compiler warnings produced by the RVCT ARM compiler
From: |
David Turner |
Subject: |
RE: [ft-devel] compiler warnings produced by the RVCT ARM compiler |
Date: |
Tue, 15 May 2007 12:37:12 +0200 |
Hello Graham,
you're right that the ctypes functions should not be used to parse
font files, but they maybe useful in other cases (e.g. parsing file names).
I've just checked their usage in the current source tree:
- isalnum and isupper are only used in ftmac.c to convert a
Postscript font name into a LWFN one, this is clearly incorrect.
- isdigit and isxdigit are used by the CID, Type1 and Type42 parsers.
I don't know if these are locale-specific, but I'm not going to take any
chances
- islower is unused
I'm going to fix this immediately. Thanks
- David Turner
- The FreeType Project (www.freetype.org)
On Tue, 15 May 2007 10:42:23 +0100, "Graham Asher" <address@hidden> said:
> Werner,
>
> I am sorry but I shan't be able to work on a ready-to-run ARM
> compilation.
> The trouble is, I am committed to working six days a week at the moment,
> and
> I can't face doing any more.
>
> On the subject of the ctype.h functions, there is nevertheless still a
> good
> case for removing the dependency on them. They are used in parsers for
> certain pieces of textual syntax in Type 1, CID and other files; these
> formats are fixed, while the ctype.h functions are locale-dependent.
> Potentially a perverse implementation of ctype.h could, for a certain
> locale
> and certain font files, change the behaviour of FreeType. This is a small
> but real risk.
>
> There is really no good reason for FreeType to use these functions, when
> the
> only required tasks are to identify uppercase and lowercase ASCII
> characters
> and decimal and hexadecimal digits.
>
> Is there a good argument for using the ctype.h functions that outweighs
> this
> consideration? In general, I think the presumption ought to be on the
> side
> of not using standard library functions unless their behaviour is not
> locale-dependent or dependent on any other factors outside FreeType, and
> either (i) they are trivial and are generally implemented correctly -
> like,
> for example, strlen; or (ii) they provide a standard wrapper to platform
> facilities - like, for example, fopen, fread, etc.
>
> Best regards,
>
> Graham
>
>
> -----Original Message-----
> From: Werner LEMBERG [mailto:address@hidden
> Sent: 15 May 2007 07:49
> To: address@hidden
> Cc: address@hidden
> Subject: Re: [ft-devel] compiler warnings produced by the RVCT ARM
> compiler
>
>
> > compiling FreeType 2.3.4 using an ARM compiler (part of the RealView
> > Compiler Tools suite: see
> > http://www.arm.com/pdfs/DUI0205G_rvct_compiler_and_libraries_guide.pdf)
> > I found some warnings and errors about the following things.
>
> Thanks, applied to the CVS.
>
> > I enclose patched versions of all the files.
>
> A ready-to-run ARM compilation can probably be set up in `builds/arm'.
> Would you like to work on this?
>
> > Finally, in many environments, using the ctype.h functions isalpha,
> > isdigit, etc., will cause writable global variables to be used.
> > [...]
>
> This is something I won't change since it is really platform
> dependent. It should be added to `builds/arm'.
>
>
> Werner
>
>
>
> _______________________________________________
> Freetype-devel mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/freetype-devel