[PATCH 0/6] fix the curly braces mismatch problem
Weiguo Li
liwg06 at foxmail.com
Sun Feb 6 01:44:08 CET 2022
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
More information about the dev
mailing list