public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jim Wilson <wilson@cygnus.com>
To: "Philippe De Muyter" <phdm@macqel.be>
Cc: ghazi@caip.rutgers.edu, bothner@cygnus.com, egcs@cygnus.com,
	law@cygnus.com
Subject: Re: egcs, does gcc fixincludes etc guarantee a stdlib.h exists?
Date: Mon, 20 Apr 1998 22:16:00 -0000	[thread overview]
Message-ID: <199804210222.TAA01907@rtl.cygnus.com> (raw)
In-Reply-To: <199804171541.RAA09891@mail.macqel.be>

	Alternatively, we could put malloc, realloc, calloc and free outside of
	__USE_FIXED_PROTOTYPES__ in the generated stdlib.h.

I have been trying to discourage you from fixing this problem in stdlib.h
because I believe it is unsafe to put stuff there by default.

I just remembered another problem.  There exist many programs which have
their own declarations of these C library functions.  Some of them them
have wrong definitions.  Some of them have definitions which are not valid
POSIX, but which agree with the system's man pages.  There may also be 
declarations in the system header files in other files which are not POSIX.
If we add our own POSIX declarations to stdlib.h, we run the risk that some
programs won't compile with gcc anymore.  Dealing with all of these bug reports
will be a hassle, and I would rather not have them in the first place.

free incidentally is not entirely safe, because many older systems define
it as returning int, whereas ISO C says it returns void.

I can see that the Objective C runtime library is a problem.  However, it
looks like they already have a fix for it there.  objc/misc.c defines
__USE_FIXED_PROTOTYPES__ itself.  That at least limits the damage to the
Objective C runtime library.  If the target system has POSIX incompatibilities,
then the Objective C runtime may fail to work, but at least C programs will
still work.

Jim

  reply	other threads:[~1998-04-20 22:16 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-04-14  9:37 Kaveh R. Ghazi
1998-04-14  7:45 ` Philippe De Muyter
1998-04-16 16:34   ` Jim Wilson
1998-04-16 18:39     ` Jeffrey A Law
1998-04-17  2:23     ` Philippe De Muyter
1998-04-17 14:49       ` Jim Wilson
1998-04-20  4:16         ` Philippe De Muyter
1998-04-17 14:42   ` Philippe De Muyter
1998-04-20 22:16     ` Jim Wilson [this message]
1998-04-21 13:29       ` Philippe De Muyter
1998-04-21 17:38         ` Jim Wilson
  -- strict thread matches above, loose matches on Subject: below --
1998-04-17  8:41 Kaveh R. Ghazi
1998-04-13 12:29 Kaveh R. Ghazi
1998-04-14  2:02 ` Philippe De Muyter
1998-04-16 15:31 ` Jim Wilson
1998-03-27 15:18 Kaveh R. Ghazi
1998-03-28 19:24 ` Philippe De Muyter
1998-03-29  5:14 ` Manfred Hollstein
1998-03-31  0:46   ` Manfred Hollstein
1998-03-31  0:46 ` Jeffrey A Law
1998-04-02 11:32   ` Per Bothner
1998-04-02  9:35     ` Jeffrey A Law

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199804210222.TAA01907@rtl.cygnus.com \
    --to=wilson@cygnus.com \
    --cc=bothner@cygnus.com \
    --cc=egcs@cygnus.com \
    --cc=ghazi@caip.rutgers.edu \
    --cc=law@cygnus.com \
    --cc=phdm@macqel.be \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).