From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8311 invoked by alias); 1 Sep 2010 11:41:20 -0000 Received: (qmail 8300 invoked by uid 22791); 1 Sep 2010 11:41:19 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 01 Sep 2010 11:41:15 +0000 Received: (qmail 16687 invoked from network); 1 Sep 2010 11:41:13 -0000 Received: from unknown (HELO orlando.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 1 Sep 2010 11:41:13 -0000 From: Pedro Alves To: Joel Brobecker Subject: Re: [RFA/commit] include alloca.h if available. Date: Wed, 01 Sep 2010 11:41:00 -0000 User-Agent: KMail/1.13.2 (Linux/2.6.33-29-realtime; KDE/4.4.2; x86_64; ; ) Cc: gdb-patches@sourceware.org References: <1283281511-30193-1-git-send-email-brobecker@adacore.com> <20100901015944.GT2986@adacore.com> <20100901043810.GW2986@adacore.com> In-Reply-To: <20100901043810.GW2986@adacore.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201009011241.10997.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-09/txt/msg00009.txt.bz2 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