bug-gnulib
[Top][All Lists]
Advanced

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

Re: ISO C 99 versus POSIX 2001


From: Paul Eggert
Subject: Re: ISO C 99 versus POSIX 2001
Date: Wed, 24 Aug 2005 11:57:40 -0700
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

Bruno Haible <address@hidden> writes:

> Gnulib's purpose is to provide portability across the mainstream
> systems, _regardless_ whether they implement the standards
> correctly.

I agree with most of the other points you made, but I'd like to demur
on this point.  Gnulib is part of the GNU project, and the GNU
project's goal is to develop a free operating system.  The GNU coding
standards make it clear that porting to incompatible proprietary
operatings systems like MSDOS, VMS, etc., is low on our long list of
things to do.

Obviously some judgment is required, but in this particular case I see
no real harm in assuming that malloc conforms to POSIX with respect to
errno.  If we don't attempt to work around the problem, MSDOS users
might get a confusing diagnostic or other such behavior when they run
out of memory.  But that's not a big deal.

If we upgrade the already-existing malloc wrapper to set errno to
ENOMEM when malloc fails, and fix the m4 code to detect the MSDOS
incompatibility with POSIX, that would be icing on the cake.  This
approach would be far preferable to modifying all our source code to
worry about non-POSIX malloc implementations.

Also, I note that in Visual C++ 2005, malloc sets errno to ENOMEM if
memory allocation fails; see
<http://msdn2.microsoft.com/library/6ewkz86d(en-us,vs.80).aspx>.
So perhaps the simplest solution here is to assume POSIX behavior and
wait for Microsoft users to upgrade themselves.




reply via email to

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