freetype
[Top][All Lists]
Advanced

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

Re: [ft] FT_Done_Face Should Not Return An Error


From: J Decker
Subject: Re: [ft] FT_Done_Face Should Not Return An Error
Date: Sat, 5 May 2018 12:41:42 -0700

On Sat, May 5, 2018 at 11:10 AM, Werner LEMBERG <address@hidden> wrote:

>
> >> It is common for object-disposal routines to never return error
> >> statuses. The archetypal example is free(3)
> >> <https://linux.die.net/man/3/free>.  If this is passed a valid
> >> pointer, it disposes of the object; if it is passed NULL, it
> >> quietly returns without doing anything.  If it is passed an invalid
> >> pointer, then this indicates a program bug, so there is no point
> >> returning an error code anyway: better to report an error message
> >> to stderr and even abort the program.
>
> I agree with Gregor: A library should not call `exit' by itself.
>

REALLY wish someone could convince libpng of that.


>
> >> [...]  Otherwise, if it is passed NULL, it should just quietly
> >> return without doing anything.  This makes it easier to write code
> >> that initializes all temporary pointers up front and
> >> unconditionally disposes them at the end; there is no need to
> >> tediously check everything for NULL pointers, because the disposal
> >> routines will take care of that.
>
> It's not clear to me how such a situation can arise with FreeType.
> Please give an example.
>
>
>     Werner
>
> _______________________________________________
> Freetype mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/freetype
>


reply via email to

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