DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Ashish Sadanandan <ashish.sadanandan@gmail.com>
Cc: Bruce Richardson <bruce.richardson@intel.com>,
	Thomas Monjalon <thomas@monjalon.net>,
	dev@dpdk.org, nelio.laranjeiro@6wind.com, stable@dpdk.org,
	honnappa.nagarahalli@arm.com, konstantin.v.ananyev@yandex.ru,
	david.marchand@redhat.com, ruifeng.wang@arm.com
Subject: Re: [PATCH 1/1] eal: add C++ include guard in generic/rte_vect.h
Date: Wed, 13 Mar 2024 16:45:36 -0700	[thread overview]
Message-ID: <20240313164536.11fff597@hermes.local> (raw)
In-Reply-To: <CAN44U22-YozP0JOVS9iNPuMXUK=zmK7DVa=DjPA4LmBtU7WQww@mail.gmail.com>

On Fri, 2 Feb 2024 13:58:19 -0700
Ashish Sadanandan <ashish.sadanandan@gmail.com> wrote:

> > I think just having the extern "C" guard in all files is the safest choice,
> > because it's immediately obvious in each and every file that it is correct.
> > Taking the other option, to check any indirect include file you need to go
> > finding what other files include it and check there that a) they have
> > include guards and b) the include for the indirect header is contained
> > within it.
> >
> > Adopting the policy of putting the guard in each and every header is also a
> > lot easier to do basic automated sanity checks on. If the file ends in .h,
> > we just use grep to quickly verify it's not missing the guards. [Naturally,
> > we can do more complete checks than that if we want, but 99% percent of
> > misses can be picked up by a grep for the 'extern "C"' bit]
> >
> > /Bruce
> >  
> 
> 100% agree with Bruce. It's a valid ideological argument that private
> headers
> don't need such safeguards, but it's difficult to enforce and easy to break
> during refactoring.
> 
> - Ashish

But splashing this across all the internal driver headers is bad idea.
It should only apply to header files that exported in final package.

  reply	other threads:[~2024-03-13 23:45 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-02  5:13 Ashish Sadanandan
2024-02-02  9:18 ` Thomas Monjalon
2024-02-02  9:40   ` Bruce Richardson
2024-02-02 20:58     ` Ashish Sadanandan
2024-03-13 23:45       ` Stephen Hemminger [this message]
2024-03-14  3:45         ` Tyler Retzlaff
2024-02-05 17:36     ` Tyler Retzlaff
2024-02-05 21:07       ` Morten Brørup
2024-02-12 15:43         ` Ferruh Yigit
2024-02-12 16:02           ` Morten Brørup
2024-03-13 20:26             ` Ashish Sadanandan
2024-03-13 20:45               ` Thomas Monjalon
2024-03-13 22:11                 ` Ashish Sadanandan
2024-02-12 15:42     ` Ferruh Yigit
2024-03-18  2:40 ` [PATCH v2 " Ashish Sadanandan
2024-03-18  2:44 ` [PATCH v3 " Ashish Sadanandan
2024-04-02 16:03   ` Ashish Sadanandan
2024-04-03 14:52     ` Thomas Monjalon
2024-04-07  1:30       ` Ashish Sadanandan
2024-04-07 17:04         ` Stephen Hemminger
2024-04-08  8:50         ` Ferruh Yigit
2024-04-08  9:04           ` Bruce Richardson
2024-04-08 15:29         ` Tyler Retzlaff
2024-04-02 16:10   ` Bruce Richardson
2024-04-02 16:19   ` Tyler Retzlaff
2024-10-07 20:20     ` Stephen Hemminger

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=20240313164536.11fff597@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=ashish.sadanandan@gmail.com \
    --cc=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=honnappa.nagarahalli@arm.com \
    --cc=konstantin.v.ananyev@yandex.ru \
    --cc=nelio.laranjeiro@6wind.com \
    --cc=ruifeng.wang@arm.com \
    --cc=stable@dpdk.org \
    --cc=thomas@monjalon.net \
    /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 NNTP newsgroup(s).