Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Yao Qi <yao@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] Always include defs.h first.
Date: Thu, 08 Nov 2012 16:56:00 -0000	[thread overview]
Message-ID: <509BE42B.3070602@redhat.com> (raw)
In-Reply-To: <509B2BCA.2050703@codesourcery.com>

On 11/08/2012 03:49 AM, Yao Qi wrote:

>> diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
>> index 05a030a..fbc2479 100644
>> --- a/gdb/arm-tdep.c
>> +++ b/gdb/arm-tdep.c
>> @@ -18,9 +18,10 @@
>>      You should have received a copy of the GNU General Public License
>>      along with this program.  If not, see<http://www.gnu.org/licenses/>.  */
>>
>> +#include "defs.h"
>> +
>>   #include <ctype.h>        /* XXX for isupper ().  */
>>
>> -#include "defs.h"
>>   #include "frame.h"
>>   #include "inferior.h"
>>   #include "gdbcmd.h"
> 
> What is the include order of "defs.h" and system headers, such as <ctype.h> and <stdio.h>?  When I learnt C programming some years ago, it was said system headers are included first, and then your own headers. This rule doesn't apply here?

defs.h includes config.h and config.h must always be included before system headers.

This is probably "authoritatively" described somewhere in autoconf's docs, but
I can't find it now.  But see e.g., <http://inaugust.com/post/68>.

-- 
Pedro Alves


  parent reply	other threads:[~2012-11-08 16:56 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-07 20:11 Pedro Alves
2012-11-08  1:34 ` Doug Evans
2012-11-08 16:49   ` Pedro Alves
2012-11-08 18:12     ` Doug Evans
2012-11-08 18:39       ` Joel Brobecker
2012-11-08 18:50         ` Pedro Alves
2012-11-08 18:55       ` Pedro Alves
2012-11-08 19:00         ` Doug Evans
2012-11-08 19:15         ` Joel Brobecker
2012-11-08 19:21     ` Tom Tromey
2012-11-08  3:49 ` Yao Qi
2012-11-08  5:04   ` Joel Brobecker
2012-11-08 16:56   ` Pedro Alves [this message]
2012-11-09  8:12     ` Yao Qi
2012-11-08 17:04 ` Pierre Muller
2012-11-08 17:16   ` Pedro Alves
2012-11-08 19:37     ` Tom Tromey

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=509BE42B.3070602@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=yao@codesourcery.com \
    /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