public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA/commit] include alloca.h if available.
Date: Wed, 01 Sep 2010 11:41:00 -0000	[thread overview]
Message-ID: <201009011241.10997.pedro@codesourcery.com> (raw)
In-Reply-To: <20100901043810.GW2986@adacore.com>

On Wednesday 01 September 2010 05:38:10, Joel Brobecker wrote:
> > If it is just for malloc, it sounds like the include is no longer
> > necessary? Unless of course malloc.h is the only location where
> > alloca is defined on mingw32.
> I just checked, and from what I can tell, no alloca.h on MinGW.

Right.  malloc.h is there for alloca, and there is no alloca.h, AFAIK.

> So the question is: Do we want to group all includes of malloc.h
> in server.h? I don't see any strong reason to believe that one
> way or the other is better, so I can live with the status quo.
> But I'm happy to group them all, or even move the include of
> alloca.h inside the various .c file as needed (it seems odd, now
> that I think of it, to include alloca.h in server.h, and yet have
> the includes of malloc.h spread out in the .c files).

This is exactly what I was pointing at.  It'd be tidier to have
alloca.h and malloc.h together, either in server.h or spread out
in the .c files, but together.  Just for the principle that
headers should only contain includes of what is scrictly necessary
for the interface they describe, I'd prefer the .c files.  But
then again, server.h is a kitchen sink, and, already includes
other related system includes like stdlib.h and string.h, that
putting it there is certainly fine, and probably avoids more work
in the future (note how I needed to add malloc.h to mem-break.c
recently for mingw32).  Thus, I mildly prefer server.h as you
have done.  But this was just a note, not a request!

-- 
Pedro Alves

  reply	other threads:[~2010-09-01 11:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-31 19:06 Joel Brobecker
2010-08-31 19:55 ` Pedro Alves
2010-09-01  1:59   ` Joel Brobecker
2010-09-01  4:38     ` Joel Brobecker
2010-09-01 11:41       ` Pedro Alves [this message]
2010-09-01 17:10         ` [RFA/gdbserver] Move malloc.h include to server.h Joel Brobecker
2010-09-01 17:12           ` Pedro Alves
2010-09-01 17:30             ` Joel Brobecker

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=201009011241.10997.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /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).