public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: GCC headers and DJGPP port
@ 2000-07-17 10:37 Mike Stump
  2000-07-17 11:11 ` Laurynas Biveinis
  2000-07-17 11:34 ` Eli Zaretskii
  0 siblings, 2 replies; 109+ messages in thread
From: Mike Stump @ 2000-07-17 10:37 UTC (permalink / raw)
  To: gcc, lauras; +Cc: djgpp-workers

> Date: Sun, 16 Jul 2000 16:42:50 +0200
> From: Laurynas Biveinis <lauras@softhome.net>
> To: gcc@gcc.gnu.org

> One of the major problems requiring addressing is relationship between
> following DJGPP and GCC-provided headers: stddef.h, stdarg.h and
> varargs.h. The problem is that GCC wants to use and install its
> own headers, but it causes type redefinitions, e.g.:

> How would you suggest to fix it?

Let it install and use its own headers, remove your headers, and fix
the port, if any of the bits are wrong.

A sure sign of a non-maintained port, is a system with its own
vararg.h...

^ permalink raw reply	[flat|nested] 109+ messages in thread
* Re: GCC headers and DJGPP port
@ 2000-07-23 13:55 Mike Stump
  2000-07-23 22:49 ` Eli Zaretskii
  0 siblings, 1 reply; 109+ messages in thread
From: Mike Stump @ 2000-07-23 13:55 UTC (permalink / raw)
  To: eliz, law; +Cc: djgpp-workers, gcc, martin, zack

> Date: Sun, 23 Jul 2000 15:20:26 -0400 (EDT)
> From: Eli Zaretskii <eliz@delorie.com>
> To: law@cygnus.com

> I believe I addressed the issues you raised in other messages.  The
> above referred to a suggestion originally made by Mike (to remove
> stddef.h and possibly other headers based on Autoconf test).

It is a modification to the scheme I suggested.  I can support the
scheme I suggested, and I would argue here for it, if it helps you.  I
am happy to do this.  I wasn't going to say anything about the change
to the scheme you suggest, as I think my previous point was clear as
to where I stood on that issue.  I, personally, would not argue for
such a modification.  I'd argue against it.  Now, that doesn't mean
that it can't go in, bear in mind, I am but one member of the list,
just one reader.  In the end, the maintainers (I am not presently one)
make the decisions, based in part on all the concerns and ideas other
might present and of course their experience, knowledge and skill.

The problem is that mirrored configury bits that are just like other
bits, but different is one of the most glaring `bad design' issues in
the compiler that I know.  I support the unification and removal of
the duplicate bits.  By configuring the headers some ways on some
machines and some ways on other machines, I feel we contribute to this
`bad design'.  For this reason, I am against your modification to my
scheme.  I'd rather simplify it, and risk the bugs, and fix any that
might arise, than do as you suggest.

Take a look at config/*/* and you'll start to see what I mean.

^ permalink raw reply	[flat|nested] 109+ messages in thread
* Re: GCC headers and DJGPP port
@ 2000-07-22 17:30 Mike Stump
  2000-07-23  4:08 ` Eli Zaretskii
  0 siblings, 1 reply; 109+ messages in thread
From: Mike Stump @ 2000-07-22 17:30 UTC (permalink / raw)
  To: eliz, law; +Cc: djgpp-workers, gcc

> Date: Sat, 22 Jul 2000 18:36:29 -0400 (EDT)
> From: Eli Zaretskii <eliz@delorie.com>
> To: law@cygnus.com

> > I would be willing to consider not installing if and only if we
> > know the system versions are correct.  Just saying yours are
> > correct isn't sufficient, you actually have to test them.

> You mean, tested by the configure script?  Please tell what features
> need to be tested, and we will try to submit the necessary changes to
> the configury.

I think he probably meant tested on all systems in all ways, once by
hand.

Anyway, if we know of classes of reasons why a native stddef.h might
not be what we want to do, we could either fixincludes it or autoconf
and not use it if we don't like it.

> We already discussed that possibility at length on the DJGPP
> developer's list, and arrived at a conclusion that it is much easier
> for us to use our headers.

And is it also much easier for you to test all systems that gcc has
ever been build for and verify your new patches are right?  See, being
ok on just your system isn't good enough to do a change...

While we could do it one way on some systems and other ways on other
systems, this creates long term configury hair I think it would be
best to avoid, if we can.

^ permalink raw reply	[flat|nested] 109+ messages in thread
* Re: GCC headers and DJGPP port
@ 2000-07-22 17:23 Mike Stump
  2000-07-22 17:40 ` Zack Weinberg
  2000-07-23  4:06 ` Eli Zaretskii
  0 siblings, 2 replies; 109+ messages in thread
From: Mike Stump @ 2000-07-22 17:23 UTC (permalink / raw)
  To: zack; +Cc: djgpp-workers, eliz, gcc, martin

> From: Zack Weinberg <zack@wolery.cumb.org>
> Date: Sat, 22 Jul 2000 16:02:26 -0700
> To: Mike Stump <mrs@windriver.com>

> A similar argument can be made for assert.h, stddef.h, and possibly
> float.h, but these headers do not cause nearly as much trouble as
> limits.h.  Limits.h must die.

If we do this, we should do them all enmass, and then be willing to
seek out and test on lots of platforms to make sure we don't introduce
new bugs.

^ permalink raw reply	[flat|nested] 109+ messages in thread
* Re: GCC headers and DJGPP port
@ 2000-07-22 15:19 Mike Stump
  2000-07-22 16:02 ` Zack Weinberg
  2000-07-23  4:05 ` Eli Zaretskii
  0 siblings, 2 replies; 109+ messages in thread
From: Mike Stump @ 2000-07-22 15:19 UTC (permalink / raw)
  To: eliz; +Cc: djgpp-workers, gcc, martin

> Date: Sat, 22 Jul 2000 05:19:10 -0400 (EDT)
> From: Eli Zaretskii <eliz@delorie.com>
> To: mrs@windriver.com

> What I am trying to do is help arrive at an acceptable way of solving
> the problem, so that those who will actually do the work would avoid
> submitting patches which will be rejected.

> Is it okay with you to discuss the remaining few headers that are
> relevant to C programs, and see which of them need to be installed by
> GCC and which can be left out?

Sure.  But only on the condition you stated above, that there _is_ in
fact a problem.

> If it's okay with you, I'd like to discuss limits.h (and syslimits.h
> that is related to it) first.  Why is it necessary for GCC to install
> its own version of this header?

Wrong question.  I'll answer it anyway, because it is best.  It is
best, because gcc already knows so much about the target system, that
it can generate this file.

A way of approaching this, would be to explain to me the problem this
causes, slowly, so that I can understand the issues, and we can work
out a solution to the problems encountered.  Also, we cannot solve
problems, without being made aware of them.  I'm not aware of too many
problems that limits.h should cause.  They two biggest problems I see
is that we have a brittle way of handling sizeof(int) == 2 and
sizeof(long)==8, that should be cleaned up and made robust.

^ permalink raw reply	[flat|nested] 109+ messages in thread
* Re: GCC headers and DJGPP port
@ 2000-07-22 13:29 Phil Edwards
  0 siblings, 0 replies; 109+ messages in thread
From: Phil Edwards @ 2000-07-22 13:29 UTC (permalink / raw)
  To: law; +Cc: djgpp-workers, eliz, gcc, martin, mrs

Jeffrey A Law <law@cygnus.com>:
> Let's take the __null issue again.  According to the C++ standard it is
> an implementation-defined C++ null pointer constant -- it also states
> that (void *)0 is not an acceptable value.
>
> It turns out that using "0" doesn't work, nor does "0L" for reasons I
> can't remember.

Overloading based on the distinction between pointer and integer becomes
impossible, or a freakish nightmare at best.  If you pass in "NULL",
you'd expect the compiler to choose the pointer version, but if it's 0 a
compiler will -- quite correctly -- choose the integer version.

With 0L you can at least hope to get an ambiguity warning.  Sometimes.
Except if the overloaded function takes a long integer, then you're
screwed again.

Having __null magically only match pointer types is an extremely froody
solution, and I'm glad that g++ went that route.


Phil

^ permalink raw reply	[flat|nested] 109+ messages in thread
* Re: GCC headers and DJGPP port
@ 2000-07-21 13:52 Mike Stump
  2000-07-22  2:19 ` Eli Zaretskii
  0 siblings, 1 reply; 109+ messages in thread
From: Mike Stump @ 2000-07-21 13:52 UTC (permalink / raw)
  To: eliz; +Cc: djgpp-workers, gcc, martin

> Date: Fri, 21 Jul 2000 03:52:39 -0400 (EDT)
> From: Eli Zaretskii <eliz@delorie.com>
> To: mrs@windriver.com

> I cannot look into the include directory of the next compiler
> release: I don't have the CVS tree on my machine, as I'm not one of
> the maintainers of the DJGPP port of GCC; and I don't know enough
> about GCC internals to efficiently look for the information anyway.
> If I could look at the headers instead of asking, I would, believe
> me.

Bear in mind, in the end, the only way to make the port work, or to
test it, will be to download it and try it.  I incorrectly assumed
the state of things, sorry.

^ permalink raw reply	[flat|nested] 109+ messages in thread
* Re: GCC headers and DJGPP port
@ 2000-07-20 17:16 Mike Stump
  2000-07-20 17:41 ` DJ Delorie
  2000-07-21  0:53 ` Eli Zaretskii
  0 siblings, 2 replies; 109+ messages in thread
From: Mike Stump @ 2000-07-20 17:16 UTC (permalink / raw)
  To: dj; +Cc: djgpp-workers, gcc

> Date: Thu, 20 Jul 2000 19:51:14 -0400
> From: DJ Delorie <dj@delorie.com>
> To: mrs@windriver.com

> Hence our desire to do the Right Thing yet avoid such disasters for
> our users.

Actually, about the only way to avoid that, is taking a more active
role in gcc, testing snapshots, reporting new problems that crop up,
submitting fixes that arise.  I don't know that any other solution
actually works in theory or practice.  :-(

In this case, a fixincludes chunk is the standard way to correct this
problem (until such time as a new release of the library comes out to
solve it).

^ permalink raw reply	[flat|nested] 109+ messages in thread
* Re: GCC headers and DJGPP port
@ 2000-07-20 16:44 Mike Stump
  2000-07-20 16:51 ` DJ Delorie
  0 siblings, 1 reply; 109+ messages in thread
From: Mike Stump @ 2000-07-20 16:44 UTC (permalink / raw)
  To: dj; +Cc: djgpp-workers, gcc

> Date: Thu, 20 Jul 2000 19:18:59 -0400
> From: DJ Delorie <dj@delorie.com>
> To: mrs@windriver.com

> When gcc added __null, the djgpp lists got a flood of user complaints
> because their programs wouldn't compile any more.

?  Can you elaborate?  Is this just the #undef/the changing your
headers to match gcc's headers problem?

^ permalink raw reply	[flat|nested] 109+ messages in thread
* Re: GCC headers and DJGPP port
@ 2000-07-20 16:08 Mike Stump
  2000-07-20 16:19 ` DJ Delorie
  0 siblings, 1 reply; 109+ messages in thread
From: Mike Stump @ 2000-07-20 16:08 UTC (permalink / raw)
  To: dj, martin; +Cc: djgpp-workers, gcc

> Date: Thu, 20 Jul 2000 18:30:42 -0400
> From: DJ Delorie <dj@delorie.com>
> To: martin@loewis.home.cs.tu-berlin.de

> > Please tell me how you implement the above requirement without testing
> > whether NULL has been defined?

> They all define it to exactly the same thing: 0

While you may like that definition, we feel that is the wrong
definition.  You can either, change it to be what we feel is right, or
ignore us.  Your choice.  If you choose to ignore us, you can submit
changes to gcc to try and work around any problems you have, but, in
the end, we may merely reject those patches as the wrong solution.

Good luck.

^ permalink raw reply	[flat|nested] 109+ messages in thread
* Re: GCC headers and DJGPP port
@ 2000-07-20 14:44 Mike Stump
  2000-07-21  0:52 ` Eli Zaretskii
  0 siblings, 1 reply; 109+ messages in thread
From: Mike Stump @ 2000-07-20 14:44 UTC (permalink / raw)
  To: eliz; +Cc: djgpp-workers, gcc, martin

> Date: Thu, 20 Jul 2000 02:41:28 -0400 (EDT)
> From: Eli Zaretskii <eliz@delorie.com>
> To: mrs@windriver.com

> > From: Mike Stump <mrs@windriver.com>
> > Date: Wed, 19 Jul 2000 14:35:28 -0700 (PDT)
>
> If you mean that we should submit patches to the GCC maintainers to
> fix the headers installed by GCC, then that's a maintenance burden
> we would like to avoid, at least for the headers that there's no
> real need for GCC to install.

I have given you three options in my other message, let me know which
path you wish to take, and I will be able to help you with the above.

> Date: Thu, 20 Jul 2000 02:44:16 -0400 (EDT)
> From: Eli Zaretskii <eliz@delorie.com>
> To: mrs@windriver.com

> > From: Mike Stump <mrs@windriver.com>
> > Date: Wed, 19 Jul 2000 14:44:15 -0700 (PDT)
> >
> > > Could you tell what other headers do we need to consider?
> > 
> > I'd rather tell you how to find the compiler include directories
> > (touch t.c && gcc -v t.c), and how to run ls (dir).

> The question was about future GCC releases, for which I cannot
> simply look in my include directories.

Don't worry about that future.  It will come and you can't stop it.
Good, bad or indifferent.  What we can worry about it what is most
likely to be in the next release.  This can be answered by looking in
the compiler's include directory, just as I said.

> > errno.h limits.h proto.h varargs.h assert.h exception math.h
> > stdarg.h syslimits.h curses.h fixed new stdbool.h typeinfo
> > cxxabi.h iso646.h new.h stddef.h

> Are all of these relevant for C programs?

No.

> Ideally, I'd like to get rid of all of the above-mentioned headers
> except varargs.h and stdarg.h.  What would we (the DJGPP
> maintainers) need to do to come as close as possible to that goal?

Submit patches, and be right and be willing to back it.

> Date: Thu, 20 Jul 2000 06:24:10 -0400 (EDT)
> From: Eli Zaretskii <eliz@delorie.com>
> To: martin@loewis.home.cs.tu-berlin.de

> What is of interest to us is what will a C function see when called
> with a __null argument from a C++ program.  This is required to DTRT
> in C headers so that they would work with C++ programs regardless of
> the order of headers inclusion (since some headers in libstdc++
> define NULL).

Do you actually expect the compiler is so broken such that the answer
would be anything other than NULL?  It is not so broken, nor has it
ever been.  You could have easily asked the compiler this as well, if
you cared.

> Date: Thu, 20 Jul 2000 10:37:16 -0400
> From: DJ Delorie <dj@delorie.com>
> To: djgpp-workers@delorie.com

> > I don't know what your copy of stdio.h looks like, however, it
> > should certainly test whether NULL is defined before defining it.

> It doesn't.  It shouldn't have to.  ANSI says that stdio.h provides
> NULL.

Gosh, my copy of a C standard says:

       53. The macro NULL  is  defined  in  <stddef.h>  as  a  null
           pointer constant; see 7.1.6.

Can you explain this?  Do other C langauge standards not have this?
Which ones?

> I have a philosophical problem with anyone saying "it should
> certainly test it" because it means that, at the whim of the gcc
> team, we'd need to add yet another test to our standard headers
> because yet another symbol was absconded by the gcc headers.

Or, maybe it is for another reason, like a hard requirement of some
language standard?

> Where does it end?  Do we have to wrap every single #define in all
> the system headers?  Will we have to wrap the function prototypes
> also?

The sky is falling...  Don't worry, it is not.  Trust us.
If you find a bit of misplaced sky, just tell us, submit a patch to
fix it, and the world continues on.

^ permalink raw reply	[flat|nested] 109+ messages in thread
* Re: GCC headers and DJGPP port
@ 2000-07-20 13:35 Mike Stump
  0 siblings, 0 replies; 109+ messages in thread
From: Mike Stump @ 2000-07-20 13:35 UTC (permalink / raw)
  To: eliz; +Cc: djgpp-workers, gcc, lauras, martin

> Date: Thu, 20 Jul 2000 02:42:48 -0400 (EDT)
> From: Eli Zaretskii <eliz@delorie.com>
> To: mrs@windriver.com

> > From: Mike Stump <mrs@windriver.com>
> > Date: Wed, 19 Jul 2000 14:38:04 -0700 (PDT)
> > 
> I'm not sure what GCC's notion of NULL are you talking about.

gcc only has one definition of NULL.  After you read it, it was my
hope you would understand it.  If you don't, you might trye
comp.lang.c.

> We cannot use __null in C headers unconditionally,

Ok, I already know that.  You must misunderstand my point if you think
I said that.

> Use of __null conditioned on __cplusplus is questionable,

At this point, I will just say trust me, do it.  You can either ignore
me, or listen to me, your choice.

> since libc.a is not compiled with that definition of NULL.  Am I
> missing something?

Yes.

> > Sprinkle in #undef NULL if you get redefinition errors.
>  
> We did use #undef to solve the immediate problem, but it looked like a
> brute-force and potentially dangerous (for C++ programs) solution.  I
> wonder if there's a better one.

No.

^ permalink raw reply	[flat|nested] 109+ messages in thread
* Re: GCC headers and DJGPP port
@ 2000-07-20 13:25 Mike Stump
  2000-07-21  0:51 ` Eli Zaretskii
  0 siblings, 1 reply; 109+ messages in thread
From: Mike Stump @ 2000-07-20 13:25 UTC (permalink / raw)
  To: eliz; +Cc: djgpp-workers, gcc, martin

> Date: Thu, 20 Jul 2000 02:41:28 -0400 (EDT)
> From: Eli Zaretskii <eliz@delorie.com>
> To: mrs@windriver.com

> > From: Mike Stump <mrs@windriver.com>
> > Date: Wed, 19 Jul 2000 14:35:28 -0700 (PDT)
>
> If you mean that we should submit patches to the GCC maintainers to
> fix the headers installed by GCC, then that's a maintenance burden we
> would like to avoid, at least for the headers that there's no real
> need for GCC to install.

> In other words, we would like to make the DJGPP library development
> as independent from GCC development as possible, so that there would
> be no immediate need to release a new library version every time a
> new version of GCC is released, and no need for the users to
> download a new GCC version each time a new library release is out.

You have three options, either submit the work to make them more
independent, submit the work to make gcc agree, or don't make them
work together (no work).  Let me know which option you want to pursue
and I can help you.  I am confused, as I don't yet know which route
you hacve decided to pursue.

^ permalink raw reply	[flat|nested] 109+ messages in thread
* Re: GCC headers and DJGPP port
@ 2000-07-19 14:44 Mike Stump
  2000-07-19 23:44 ` Eli Zaretskii
  0 siblings, 1 reply; 109+ messages in thread
From: Mike Stump @ 2000-07-19 14:44 UTC (permalink / raw)
  To: eliz; +Cc: djgpp-workers, gcc, martin

> Date: Wed, 19 Jul 2000 14:26:49 -0400 (EDT)
> From: Eli Zaretskii <eliz@delorie.com>
> To: mrs@windriver.com

> > and other headers I think we'd need to talk about specifically and
> > weigh the issues.

> Could you tell what other headers do we need to consider?

I'd rather tell you how to find the compiler include directories
(touch t.c && gcc -v t.c), and how to run ls (dir).

When I do this on my system, I get:

errno.h limits.h proto.h varargs.h assert.h exception math.h stdarg.h
syslimits.h curses.h fixed new stdbool.h typeinfo cxxabi.h iso646.h
new.h stddef.h

but some of those are fixincluded, and these aren't all the
directories.

^ permalink raw reply	[flat|nested] 109+ messages in thread
* Re: GCC headers and DJGPP port
@ 2000-07-19 14:38 Mike Stump
  2000-07-19 16:04 ` Bruce Korb
  2000-07-19 23:43 ` Eli Zaretskii
  0 siblings, 2 replies; 109+ messages in thread
From: Mike Stump @ 2000-07-19 14:38 UTC (permalink / raw)
  To: eliz, martin; +Cc: djgpp-workers, gcc, lauras

> Date: Wed, 19 Jul 2000 14:26:25 -0400 (EDT)
> From: Eli Zaretskii <eliz@delorie.com>
> To: martin@loewis.home.cs.tu-berlin.de

> Seriously, though: the conclusion was that we didn't like the
> redefinition of NULL in C++ headers (see my other message for the
> problems this causes).  But we couldn't understand why does the C++
> compiler redefines NULL in its headers, so we couldn't find a
> solution that would satisfy us all and avoid breaking the C++
> compiler at the same time.  Perhaps you could help.

Sure, change all definitions of NULL to more closely match gcc's
notion of null, and you're done.  Sprinkle in #undef NULL if you get
redefinition errors.

^ permalink raw reply	[flat|nested] 109+ messages in thread
* Re: GCC headers and DJGPP port
@ 2000-07-19 14:35 Mike Stump
  2000-07-19 23:41 ` Eli Zaretskii
  0 siblings, 1 reply; 109+ messages in thread
From: Mike Stump @ 2000-07-19 14:35 UTC (permalink / raw)
  To: eliz, martin; +Cc: djgpp-workers, gcc

> Date: Wed, 19 Jul 2000 14:25:53 -0400 (EDT)
> From: Eli Zaretskii <eliz@delorie.com>
> To: martin@loewis.home.cs.tu-berlin.de

> Yes, the actual problem is that GCC installs its headers in a way
> that cause them to be used before the system headers.  A related
> problem is that GCC uses its own versions of stddef.h, limits.h, and
> other headers instead of the system headers when GCC is built.  We
> were worried that using headers that are different from the system
> headers might produce buggy GCC binaries, due to conflicts with
> libc.a against which the native DJGPP port is linked.

Worrying isn't useful.  Verify that they are accurate and
don't cause problems and be done with it.  If there are bugs in them,
fix them, submit the patches to fix them, and be done with it.

^ permalink raw reply	[flat|nested] 109+ messages in thread
* Re: GCC headers and DJGPP port
@ 2000-07-19 14:12 Mike Stump
  0 siblings, 0 replies; 109+ messages in thread
From: Mike Stump @ 2000-07-19 14:12 UTC (permalink / raw)
  To: jbuck, lauras; +Cc: djgpp-workers, eliz, gcc, martin

> From: Joe Buck <jbuck@racerx.synopsys.com>
> To: lauras@softhome.net (Laurynas Biveinis)
> Date: Wed, 19 Jul 2000 08:24:23 -0700 (PDT)

> Wouldn't it break the SunOS4 port, or other ports where we're
> bootstrapping from an ancient K&R environment and the C library
> is highly nonstandard?

> (I suppose stddef.h could be omitted only on the platforms where it
> causes problems.)

You must have missed were I talked about autoconfing it, and including
it in environments that don't otherwise already have one, and not
including it otherwise.  By eject, I don't mean outright removal in
100% of the cases.  If 100% of the systems already have stddef.h that
work well, then we could remove it entirely.

^ permalink raw reply	[flat|nested] 109+ messages in thread
* Re: GCC headers and DJGPP port
@ 2000-07-18 20:46 Mike Stump
  2000-07-19  4:40 ` Laurynas Biveinis
  2000-07-19 11:26 ` Eli Zaretskii
  0 siblings, 2 replies; 109+ messages in thread
From: Mike Stump @ 2000-07-18 20:46 UTC (permalink / raw)
  To: eliz, martin; +Cc: djgpp-workers, gcc

> Date: Tue, 18 Jul 2000 04:10:45 -0400 (EDT)
> From: Eli Zaretskii <eliz@delorie.com>
> To: martin@loewis.home.cs.tu-berlin.de

> > NULL is defined as __null on all platforms now

> Not in DJGPP.  __null causes trouble in C programs.

The definition I was talking about does not.

> And yes, we did read all the threads in GCC archives that appear to
> be relevant, and we did discuss them at length.  But we still do not
> understand the technical considerations that caused GCC to insist on
> installing its own headers.  Please help us understand this.

Well, I reviewed stddef.h, as it is one of the culprits.  After
reading it, I came to the conclusion that we can probably eject it
from the compiler safely.  It does seem like there is little reason to
have it in the compiler, better to be apart of newlib, of glibc, and
then all the complexity of it, and the heartache it causes, goes
away, permanently.

We can even autoconf the target headers, and provide it, if the target
doesn't (to be backward compatible with systems that didn't have it
because of gcc), and to not provide it, if the target system has one.

The other headers, like varargs.h, might as well be in the compiler.
The compiler has to be able to generate code, assuming it does this,
it _must_ know about the varargs mechanism.  Because it already must
know about it, it doesn't require any more information to have gcc
provide stdarg.h and varargs.h, because the compiler generates them,
they are consistent with the compiler, and cannot be wrong (experts
need not correct me, I know this is a lie).

Not, all libcs can replicate varargs, but why force them to?  What
good is it?

Another example of a header we can eject is assert.h.  I don't see a
good reason for it to stay in gcc anymore.  Sure, gcc can provide
it, if the system is unwilling, but that should be rare (and rarer
as time goes on).

> Date: Tue, 18 Jul 2000 04:11:53 -0400 (EDT)
> From: Eli Zaretskii <eliz@delorie.com>
> To: mrs@windriver.com

> > From: Mike Stump <mrs@windriver.com>
> > Date: Mon, 17 Jul 2000 14:28:17 -0700 (PDT)
> > 
> > Simple, gcc knows the target system, including details that affect
> > these things.  Does it mean that gcc has to know a bit about target
> > system, sure.

> GCC should have no problems knowing a bit about a target system: it
> just needs to include the system headers for that.  It's all there.

#inlcuding varargs.h doesn't help gcc generate varargs code.

> This is *exactly* the point: no matter how much we read and re-read
> the relevant discussions in GCC archives, we could _not_ understand
> why there's a need for __null in C programs.

Of course not.  There is no need.

> > varargs.h, is another good example.  Ours works, it'll always
> > work, we prefer it, why not use it?  Is your version safe with
> > -fstrict-aliasing?  Are you sure?  By using ours, we know ours is.

> Are you sure your version doesn't break the library?  I don't think
> you can be sure of that, unless you really studied the internals of
> that particular library.

?  I am at a complete loss as to what to say to this.  Explain how
varargs.h could break the library.  I don't understand how it could.

> IMHO, it is the business of library maintainers to make sure their
> definitions work correctly.  While suggesting to use GCC's
> definitions is nice, they should not be _forced_ on the library,
> because there's a slight chance that the library maintainers can
> indeed get it right on their own.

Sure, they can.  But why should they duplicate the work and hair of
varargs.h?  There is a slight chance that the compiler vendor can
indeed get it right on their own.

> In other words, the possibility that system headers might not work
> right is IMHO not a valid technical reason to force a library to use
> different definitions.  GCC should simply assume that the system
> headers work, and if they don't, tell the maintainers to get them
> right.

Your experience dealing with system vendors differs from our
experience dealing with vendors.

> To: Eli Zaretskii <eliz@is.elta.co.il>
> From: Geoff Keating <geoffk@cygnus.com>
> Date: 18 Jul 2000 09:37:01 -0700

> > I already posted a response: size_t and the rest *are* known at build
> > time: they are defined in the system headers.  GCC could simply use
> > them to build itself.

> It can't do that because your headers might conflict with the
> headers on the system that GCC is being built for.  I'm sure you're
> not trying to claim that someone can include both your <stddef.h>
> and the one on Solaris at the same time...

?  This is a non-issue.  The target compiler never includes
/usr/include, so no conflict is in fact possible.



Bottom line, If you want to do up patches to autoconf for stddef.h,
assert.h and iso646.h and not install them if the system already has
them, I'd invite you to, I don't think anyone will argue to keep them.
Before we do this, I'd like a person like drepper to buy into it as
well, though I don't think he'll mind.

varargs.h, I think we should reject, and other headers I think we'd
need to talk about specifically and weigh the issues.

^ permalink raw reply	[flat|nested] 109+ messages in thread
* Re: GCC headers and DJGPP port
@ 2000-07-17 14:28 Mike Stump
  2000-07-18  1:12 ` Eli Zaretskii
  0 siblings, 1 reply; 109+ messages in thread
From: Mike Stump @ 2000-07-17 14:28 UTC (permalink / raw)
  To: eliz; +Cc: djgpp-workers, gcc

> Date: Mon, 17 Jul 2000 14:34:27 -0400 (EDT)
> From: Eli Zaretskii <eliz@delorie.com>
> To: Mike Stump <mrs@windriver.com>

> > From: Mike Stump <mrs@windriver.com>
> > Date: Mon, 17 Jul 2000 10:36:53 -0700 (PDT)
> > 
> Sorry, I don't understand how can this ever work reliably.

Simple, gcc knows the target system, including details that affect
these things.  Does it mean that gcc has to know a bit about target
system, sure.  Welcome to gcc.

> I don't see how can GCC provide definitions that will never conflict
> with library internals.  Please tell what am I missing.

> How about a system with its own stddef.h?  Standard types such as
> the definition of NULL -- these are surely closely related to the
> internals of a library, right?

:-) Actually, this is the canonical example for of one that we prefer
our definition for.  Understand why we #define it to __null and you'll
gain a better understanding of the issues.

varargs.h, is another good example.  Ours works, it'll always work, we
prefer it, why not use it?  Is your version safe with
-fstrict-aliasing?  Are you sure?  By using ours, we know ours is.

^ permalink raw reply	[flat|nested] 109+ messages in thread
* GCC headers and DJGPP port
@ 2000-07-16  7:36 Laurynas Biveinis
  2000-07-17  4:24 ` Jeffrey A Law
  0 siblings, 1 reply; 109+ messages in thread
From: Laurynas Biveinis @ 2000-07-16  7:36 UTC (permalink / raw)
  To: gcc; +Cc: DJGPP Workers

For the upcoming GCC 3.0 release, DJGPP team has decided to make GCC
build out-of-box. Of course, GCC has been ported there for a long
time. However, the port was not clean due to many reasons - missing
UNIXish features, ports of bash and other programs. Most of those
problems were addressed, but few porting issues still exist. We
would appreciate any help there.

One of the major problems requiring addressing is relationship between
following DJGPP and GCC-provided headers: stddef.h, stdarg.h and
varargs.h. The problem is that GCC wants to use and install its
own headers, but it causes type redefinitions, e.g.:
---
In file included from ../../gcc/tsystem.h:52,
                 from ../../gcc/libgcc2.c:37:
d:/djgpp/include/stdio.h:35: warning: redefinition of `va_list'
include/stdarg.h:110: warning: `va_list' previously declared here
d:/djgpp/include/stdio.h:38: warning: redefinition of `size_t'
include/stddef.h:199: warning: `size_t' previously declared here
In file included from ../../gcc/tsystem.h:69,
                 from ../../gcc/libgcc2.c:37:
d:/djgpp/include/stdlib.h:39: warning: redefinition of `wchar_t'
include/stddef.h:287: warning: `wchar_t' previously declared here
---
How would you suggest to fix it?
Currently we see following possible solutions:
1) Override USER_H and not install those headers for DJGPP.
However, discussion between FreeBSD maintainers and you showed
that you're not going to accept this solution, although we
were unable to find any _technical_ arguments for doing so.
Previously GCC on DJGPP has always worked without installing
its own headers and that's the preferred solution for us,
unless there are serious objections.

This means that either ours, either yours (or both) headers
should be changed, the question - which ones and how?
Right now we have one internal header which defines macros
which define types, like:
#define __DJ_size_t typedef long unsigned int size_t;
Now in our headers which need size_t we do:
__DJ_size_t
#undef __DJ_size_t
#define __DJ_size_t
This way we prevent multiple redefinitions.

So we could:
2) Add that stuff to GCC headers:
#ifdef __DJGPP__
#include <sys/djtypes.h>
__DJ_size_t
#undef __DJ_size_t
#define __DJ_size_t
#else
typedef ...
#endif
This trick would get DJGPP definitions and this solution is OK
with us, but is it OK with you? It means that DJGPP and your
definitions may differ and this is not good if you wanted to
have common definitions for all systems.

3) The last possible solution is adjusting our headers. While we
admit that our headers are not 100%-ANSI compatible (e.g. stdio.h
defines va_list), it would break backwards compatibility and would 
require DJGPP users to upgrade if they want later GCC version (If 
I understand correctly, one of the arguments for installing your 
headers is that user should not have to update library if he wants 
newer GCC? But in this case it would cause the opposite).
This solution is the worst from the end-user's point of view and
we see it as last resort.

What are your opinions and suggestions?
Thanks in advance,
DJGPP team

^ permalink raw reply	[flat|nested] 109+ messages in thread

end of thread, other threads:[~2000-07-23 22:49 UTC | newest]

Thread overview: 109+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-07-17 10:37 GCC headers and DJGPP port Mike Stump
2000-07-17 11:11 ` Laurynas Biveinis
2000-07-17 12:05   ` Bruce Korb
2000-07-17 12:28     ` DJ Delorie
2000-07-17 13:47       ` Bruce Korb
2000-07-17 13:32     ` Laurynas Biveinis
2000-07-18  1:09     ` Eli Zaretskii
2000-07-18  1:51       ` Laurynas Biveinis
2000-07-18  2:06         ` Eli Zaretskii
2000-07-18  2:22           ` Laurynas Biveinis
2000-07-18  9:32         ` Geoff Keating
2000-07-17 12:07   ` Mark E.
2000-07-17 11:34 ` Eli Zaretskii
2000-07-17 14:10   ` Martin v. Loewis
2000-07-17 15:40     ` Jeffrey A Law
2000-07-17 16:26       ` Mark E.
2000-07-17 19:36         ` Bruce Korb
2000-07-18  1:10     ` Eli Zaretskii
2000-07-18  1:51       ` Laurynas Biveinis
2000-07-18  3:09         ` Eli Zaretskii
2000-07-18  9:37           ` Geoff Keating
2000-07-18 12:20           ` Martin v. Loewis
2000-07-19  4:40             ` Laurynas Biveinis
2000-07-19 11:26             ` Eli Zaretskii
2000-07-20  0:49               ` Martin v. Loewis
2000-07-20  3:24                 ` Eli Zaretskii
2000-07-20  5:13                   ` Martin v. Loewis
2000-07-20  7:37                     ` DJ Delorie
2000-07-20 13:47                       ` Martin v. Loewis
2000-07-20 14:38                         ` Michael Meissner
2000-07-20 15:30                         ` DJ Delorie
2000-07-21 11:34                       ` Geoff Keating
2000-07-22  2:06                         ` Eli Zaretskii
2000-07-21  0:49                     ` Eli Zaretskii
2000-07-21  9:03                       ` Martin v. Loewis
2000-07-21 11:10                     ` Marc Espie
2000-07-20  9:13                   ` Bruce Korb
2000-07-20  9:54                     ` Zack Weinberg
2000-07-20 10:49                     ` Eli Zaretskii
2000-07-20 11:41                   ` Bruce Korb
2000-07-20 12:02                     ` Zack Weinberg
2000-07-20 12:32                   ` Bruce Korb
2000-07-20 19:16                     ` Zack Weinberg
2000-07-21 13:10                       ` Loren James Rittle
2000-07-22 16:10                         ` Zack Weinberg
2000-07-18 11:44       ` Martin v. Loewis
2000-07-19 11:26         ` Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2000-07-23 13:55 Mike Stump
2000-07-23 22:49 ` Eli Zaretskii
2000-07-22 17:30 Mike Stump
2000-07-23  4:08 ` Eli Zaretskii
2000-07-22 17:23 Mike Stump
2000-07-22 17:40 ` Zack Weinberg
2000-07-23  4:06 ` Eli Zaretskii
2000-07-23  8:39   ` Jeffrey A Law
2000-07-23 12:20     ` Eli Zaretskii
2000-07-23 22:49     ` Eli Zaretskii
2000-07-22 15:19 Mike Stump
2000-07-22 16:02 ` Zack Weinberg
2000-07-23  4:05 ` Eli Zaretskii
2000-07-22 13:29 Phil Edwards
2000-07-21 13:52 Mike Stump
2000-07-22  2:19 ` Eli Zaretskii
2000-07-22  9:32   ` Jeffrey A Law
2000-07-22 11:13     ` Gabriel Dos Reis
2000-07-22 15:36     ` Eli Zaretskii
2000-07-20 17:16 Mike Stump
2000-07-20 17:41 ` DJ Delorie
2000-07-21  0:53 ` Eli Zaretskii
2000-07-20 16:44 Mike Stump
2000-07-20 16:51 ` DJ Delorie
2000-07-20 16:08 Mike Stump
2000-07-20 16:19 ` DJ Delorie
2000-07-20 20:10   ` Mark Mitchell
2000-07-20 14:44 Mike Stump
2000-07-21  0:52 ` Eli Zaretskii
2000-07-20 13:35 Mike Stump
2000-07-20 13:25 Mike Stump
2000-07-21  0:51 ` Eli Zaretskii
2000-07-19 14:44 Mike Stump
2000-07-19 23:44 ` Eli Zaretskii
2000-07-20  4:22   ` Martin v. Loewis
2000-07-20  6:24     ` Mark E.
2000-07-20  8:23       ` Eli Zaretskii
2000-07-21  0:49     ` Eli Zaretskii
2000-07-21  8:51       ` Martin v. Loewis
2000-07-21 11:12         ` Eli Zaretskii
2000-07-21 11:48           ` Mo McKinlay
2000-07-22  2:10             ` Eli Zaretskii
2000-07-22  9:11               ` Jeffrey A Law
2000-07-22 15:33                 ` Eli Zaretskii
2000-07-19 14:38 Mike Stump
2000-07-19 16:04 ` Bruce Korb
2000-07-19 23:43 ` Eli Zaretskii
2000-07-20  4:23   ` Martin v. Loewis
2000-07-19 14:35 Mike Stump
2000-07-19 23:41 ` Eli Zaretskii
2000-07-20  4:20   ` Martin v. Loewis
2000-07-19 14:12 Mike Stump
2000-07-18 20:46 Mike Stump
2000-07-19  4:40 ` Laurynas Biveinis
2000-07-19  8:26   ` Joe Buck
2000-07-19 11:28     ` Eli Zaretskii
2000-07-19 11:26 ` Eli Zaretskii
2000-07-17 14:28 Mike Stump
2000-07-18  1:12 ` Eli Zaretskii
2000-07-16  7:36 Laurynas Biveinis
2000-07-17  4:24 ` Jeffrey A Law
2000-07-17  5:18   ` Laurynas Biveinis

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).