DPDK patches and discussions
 help / color / mirror / Atom feed
From: Weiguo Li <liwg06@foxmail.com>
To: dev@dpdk.org
Subject: [PATCH 0/6] fix the curly braces mismatch problem
Date: Sun,  6 Feb 2022 08:44:08 +0800	[thread overview]
Message-ID: <tencent_F6238474ECBE8F462E456862FE79944E5109@qq.com> (raw)

To make C header file compatible with C++ linking, a conventional
practice enclose the code with braces as below:

#ifdef __cplusplus
extern "C" {
#endif

...

#ifdef __cplusplus
}
#endif

Some alternative forms of "#ifdef __cplusplus", like 
"#if defined(__cplusplus)" or "# ifdef __cplusplus", also work.

While it's suspicious when a header file matchs this regular
expression "if.*__cplusplus" exactly once.

The following script is used to find these files:
grep -r ~/git/dpdk --include=*.h -e "if.*__cplusplus" -c|grep ":1$"

Apart from two false positive cases, I found some real issues --
some missing the left brace parts, the others missing the right
brace parts. 

In one of the cases, the c++ guard is removed since it's useless in 
private header as previous patch (http://dpdk.org/patch/98948) noted.
For the other cases, the missing parts are supplemented.

Weiguo Li (6):
  bus/dpaa: fix the curly braces mismatch problem
  common/mlx5: fix the curly braces mismatch problem
  net/cxgbe: fix the curly braces mismatch problem
  net/dpaa2: fix the curly braces mismatch problem
  eal/windows: fix the curly braces mismatch problem
  eventdev: remove C++ include guard from private header

 drivers/bus/dpaa/include/fsl_fman.h         | 5 +++++
 drivers/bus/dpaa/rte_dpaa_bus.h             | 4 ++++
 drivers/common/mlx5/windows/mlx5_win_defs.h | 5 +++++
 drivers/common/mlx5/windows/mlx5_win_ext.h  | 4 ++++
 drivers/net/cxgbe/base/common.h             | 5 +++++
 drivers/net/dpaa2/dpaa2_sparser.h           | 5 +++++
 lib/eal/windows/include/dirent.h            | 4 ++++
 lib/eventdev/eventdev_pmd.h                 | 4 ----
 8 files changed, 32 insertions(+), 4 deletions(-)

-- 
2.25.1


             reply	other threads:[~2022-02-06  0:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-06  0:44 Weiguo Li [this message]
2022-02-07  9:29 ` Bruce Richardson
2022-02-07 11:44 ` Weiguo Li
2022-02-07 13:39   ` Bruce Richardson
2022-02-08 16:21     ` Thomas Monjalon

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=tencent_F6238474ECBE8F462E456862FE79944E5109@qq.com \
    --to=liwg06@foxmail.com \
    --cc=dev@dpdk.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 NNTP newsgroup(s).