bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Bruno Haible <bruno@clisp.org>
To: bug-gnulib@gnu.org, Paul Eggert <eggert@cs.ucla.edu>
Subject: Re: [PATCH] math: Silence -Winclude-next-absolute-path warning.
Date: Mon, 19 Feb 2024 12:03:16 +0100	[thread overview]
Message-ID: <5940661.qqrk5fENW1@nimes> (raw)
In-Reply-To: <e15b93d8-4d4e-4c0e-aefa-0374586618f1@cs.ucla.edu>

Paul Eggert wrote:
> On 2024-02-18 04:19, Bruno Haible wrote:
> > +When including including specific header files, you need to use the
> > +@samp{#include <...>} syntax, not the @samp{#include "..."} syntax.
> 
> Why does Gnulib source code ever use the #include "..." syntax?

Because that's the way the rest of the world does it:
  - GNU documentation: [1][2]
  - Stackoverflow beginner's question: [3]
  - Actual use in source code (codesearch.debian.net):
    11954285 times  include "
     9623421 times  include <

> I don't 
> see why it's helpful, given that one must always use -I to name the 
> source code directory anyway.

It's helpful, in order to not deter contributors, to use coding styles
like the rest of the world does. GNU coding style is a deterrence, the
Gnulib module system is another one; but these ones are necessary (i.e.
have a good benefit). Whereas writing #include <...> everywhere has
very little benefit.

> If there's a reason for using #include "..." it should be documented; if 
> not, Gnulib should stop doing it as it's just a recipe for trouble.

I disagree:
  - New idiosyncrasies do not help to attract contributors.
  - As documented, the requirement to use #include <...> for specific header
    files exists for packages that use Gnulib. If you were to change the
    code in Gnulib, that does not change the one in bison, coreutils, gettext,
    wget2, and so on.

Bruno

[1] https://gcc.gnu.org/onlinedocs/cpp/Include-Syntax.html
[2] https://gcc.gnu.org/onlinedocs/cpp/Search-Path.html
[3] https://stackoverflow.com/questions/21593/





  reply	other threads:[~2024-02-19 11:03 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-17  8:36 [PATCH] math: Silence -Winclude-next-absolute-path warning Collin Funk
2024-02-17 10:51 ` Bruno Haible
2024-02-17 12:26   ` Collin Funk
2024-02-17 13:17     ` Bruno Haible
2024-02-18 12:19     ` Bruno Haible
2024-02-18 12:44       ` syntax-check rule to silence " Bruno Haible
2024-02-18 20:12         ` Collin Funk
2024-02-18 20:33           ` Bruno Haible
2024-02-19  5:02             ` Jim Meyering
2024-02-19 18:11               ` Collin Funk
2024-02-19 18:32                 ` Jim Meyering
2024-02-19  8:45             ` Simon Josefsson via Gnulib discussion list
2024-02-19 20:39               ` Jim Meyering
2024-02-20 15:17               ` Bruno Haible
2024-02-20 20:23         ` Collin Funk
2024-02-20 20:49           ` Bruno Haible
2024-02-19  6:31       ` [PATCH] math: Silence " Paul Eggert
2024-02-19 11:03         ` Bruno Haible [this message]
2024-02-19 20:41           ` Paul Eggert
2024-02-19 21:24             ` Bruno Haible
2024-02-19 21:45               ` Paul Eggert

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

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

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

  git send-email \
    --in-reply-to=5940661.qqrk5fENW1@nimes \
    --to=bruno@clisp.org \
    --cc=bug-gnulib@gnu.org \
    --cc=eggert@cs.ucla.edu \
    /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).