From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id AB7AE43DC3; Tue, 2 Apr 2024 18:03:36 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 88AEC4028C; Tue, 2 Apr 2024 18:03:35 +0200 (CEST) Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) by mails.dpdk.org (Postfix) with ESMTP id 15AEE4026F; Tue, 2 Apr 2024 18:03:35 +0200 (CEST) Received: by mail-ed1-f41.google.com with SMTP id 4fb4d7f45d1cf-56c197d042fso6399398a12.0; Tue, 02 Apr 2024 09:03:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712073814; x=1712678614; darn=dpdk.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=HqbTJN0CsM7jh1vGkll6Eg1fk3/bL6KJF+QVyh9NIm0=; b=eQKrjsj08qXmSwZ96+NECZ786egnX7tdkLGyhyek3dmQktx3+aIyUA/MEt7Hm4e+ri Gc0YQP8W7nCyVuYtdXWwyTQJS6pSvGyahHyUj5/bexy6CBXJdEVytWLyJ2OgzYjy9uM9 Inn/VrbTBnq7W6xHYdbVdy1kBJlXUklWhGfzrHWo/ituay96VH0y+kPWRwfOE7K3UkJ7 R6mnTzLKdVWgTlLB1YNoxehKEerngMjYZgJWJGRz6EW9yg304runPgi7Nfyf92468lvO b0QCtkwQ4IAgu03nGyFacvVw5BZtlLHPvMAEs4BMr1szCy14dwNDQgQZx/JJeqx2oJar XP1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712073814; x=1712678614; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=HqbTJN0CsM7jh1vGkll6Eg1fk3/bL6KJF+QVyh9NIm0=; b=somJvPRgYxhw35Ipln3vGKK4hn2amQavR7vf+uwis6IvPxgNWwXYF4xoyRW2PxZN/i fi83w3K/wVC039DoyX2ZGaG0SxDkBf7S8upjjbwjaVDbW6vjPFvuBH2wr/jEcfDbG6kM HuGuUXQW5+6Z8T7JRuLCmdnWGlHAOQNfDcgSKEEaPxa/bhUNlm9BDTcG9swGjcMAyWQf gE2ovvKhf4ujnBmKUpDwAe4bGSRoeoohod/VuXBQAobbw0oKrCylwgZ5mHFwJFmcQ217 FcCTyRoudmz8L+vNWou30emlfE53wLaYglTyZ9Z9NJDbEAbiqgDbQQTuno6uGP9gIGAF hESg== X-Forwarded-Encrypted: i=1; AJvYcCVQ3UXBxMQadOh7WQYV43nkmsAJRxDEu+qzFM6kXEZWE4f5mjAFUE3fbB2ZtQsLKQMcnrQE5H+QelptRH3N4/w= X-Gm-Message-State: AOJu0Yw7NTOQG3rrjKA542FmT2fJobJgsi/7bEng8uB7OUxEVYFS9Jy/ UORpZghYM3CZcJk1rT0WjM43ZgrzkiTsnvxX4fuZK9T90yzv3oPU5M4uOTMrJ9tHx86BNAyyxOk LJ1hmJv7vnjbgnRLCEoQuZU50c62gAB++ X-Google-Smtp-Source: AGHT+IGKkrfC1HwfQv/Vb3H0ql8ZSVDi24lT5XKP7der+JnT0y34sch88M6YQH5isYOyjUapoBdlWuyLPLiIZSh2bLc= X-Received: by 2002:a05:6402:3487:b0:56d:ee61:6874 with SMTP id v7-20020a056402348700b0056dee616874mr1458461edc.20.1712073814235; Tue, 02 Apr 2024 09:03:34 -0700 (PDT) MIME-Version: 1.0 References: <20240202051335.776290-1-ashish.sadanandan@gmail.com> <20240318024415.555614-1-ashish.sadanandan@gmail.com> In-Reply-To: <20240318024415.555614-1-ashish.sadanandan@gmail.com> From: Ashish Sadanandan Date: Tue, 2 Apr 2024 10:03:07 -0600 Message-ID: Subject: Re: [PATCH v3 1/1] eal: add C++ include guard in generic/rte_vect.h To: dev@dpdk.org, Thomas Monjalon Cc: nelio.laranjeiro@6wind.com, stable@dpdk.org Content-Type: multipart/alternative; boundary="00000000000086e4ae06151f3fb0" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org --00000000000086e4ae06151f3fb0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi everyone, I've made the updates as suggested. Could someone please review the latest patchset? Not sure if I followed the new patchset instructions correctly, I've always had trouble with that part. Thanks, Ashish. On Sun, Mar 17, 2024 at 8:44=E2=80=AFPM Ashish Sadanandan < ashish.sadanandan@gmail.com> wrote: > The header was missing the extern "C" directive which causes name > mangling of functions by C++ compilers, leading to linker errors > complaining of undefined references to these functions. > > Also updated the coding style contribution guideline with a new > "Language Linkage" section stating `extern "C"` block should be added to > public headers. > > Fixes: 86c743cf9140 ("eal: define generic vector types") > Cc: nelio.laranjeiro@6wind.com > Cc: stable@dpdk.org > > Signed-off-by: Ashish Sadanandan > --- > .mailmap | 2 +- > doc/guides/contributing/coding_style.rst | 21 +++++++++++++++++++++ > lib/eal/include/generic/rte_vect.h | 8 ++++++++ > 3 files changed, 30 insertions(+), 1 deletion(-) > > diff --git a/.mailmap b/.mailmap > index 50726e1232..24de59ba89 100644 > --- a/.mailmap > +++ b/.mailmap > @@ -142,7 +142,7 @@ Ashijeet Acharya > Ashish Gupta < > ashish.gupta@caviumnetworks.com> > Ashish Jain > Ashish Paul > -Ashish Sadanandan > +Ashish Sadanandan < > quic_asadanan@quicinc.com> > Ashish Shah > Ashwin Sekhar T K > > Asim Jamshed > diff --git a/doc/guides/contributing/coding_style.rst > b/doc/guides/contributing/coding_style.rst > index 1ebc79ca3c..27c947fcec 100644 > --- a/doc/guides/contributing/coding_style.rst > +++ b/doc/guides/contributing/coding_style.rst > @@ -106,6 +106,27 @@ Headers should be protected against multiple > inclusion with the usual: > > #endif /* _FILE_H_ */ > > +Language Linkage > +~~~~~~~~~~~~~~~~ > + > +Public headers should enclose all function and variable declarations and > definitions in an ``extern "C"`` block to facilitate interoperability wit= h > C++. > + > +.. code-block:: c > + > + #ifndef _FILE_H_ > + #define _FILE_H_ > + > + #ifdef __cplusplus > + extern "C" { > + #endif > + > + /* Code */ > + > + #ifdef __cplusplus > + } > + #endif > + > + #endif /* _FILE_H_ */ > > Macros > ~~~~~~ > diff --git a/lib/eal/include/generic/rte_vect.h > b/lib/eal/include/generic/rte_vect.h > index 6540419cd2..3578d8749b 100644 > --- a/lib/eal/include/generic/rte_vect.h > +++ b/lib/eal/include/generic/rte_vect.h > @@ -15,6 +15,10 @@ > > #include > > +#ifdef __cplusplus > +extern "C" { > +#endif > + > #ifndef RTE_TOOLCHAIN_MSVC > > /* Unsigned vector types */ > @@ -226,4 +230,8 @@ uint16_t rte_vect_get_max_simd_bitwidth(void); > */ > int rte_vect_set_max_simd_bitwidth(uint16_t bitwidth); > > +#ifdef __cplusplus > +} > +#endif > + > #endif /* _RTE_VECT_H_ */ > -- > 2.31.1 > > --00000000000086e4ae06151f3fb0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi everyone,
I've made the updates as s= uggested. Could someone please review the latest patchset? Not sure if I fo= llowed the new patchset instructions correctly, I've always had trouble= with that part.

Thanks,
Ashish.

On Sun, Mar 17, 2024 at 8:44=E2=80=AFPM Ashish Sadanandan <ashish.sadanandan@gmail.com> wro= te:
The header w= as missing the extern "C" directive which causes name
mangling of functions by C++ compilers, leading to linker errors
complaining of undefined references to these functions.

Also updated the coding style contribution guideline with a new
"Language Linkage" section stating `extern "C"` block s= hould be added to
public headers.

Fixes: 86c743cf9140 ("eal: define generic vector types")
Cc: nelio.l= aranjeiro@6wind.com
Cc: stable@dpdk.org

Signed-off-by: Ashish Sadanandan <
ashish.sadanandan@gmail.com>
---
=C2=A0.mailmap=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0 2 +-
=C2=A0doc/guides/contributing/coding_style.rst | 21 +++++++++++++++++++++ =C2=A0lib/eal/include/generic/rte_vect.h=C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0 = 8 ++++++++
=C2=A03 files changed, 30 insertions(+), 1 deletion(-)

diff --git a/.mailmap b/.mailmap
index 50726e1232..24de59ba89 100644
--- a/.mailmap
+++ b/.mailmap
@@ -142,7 +142,7 @@ Ashijeet Acharya <ashijeet.acharya@6wind.com>
=C2=A0Ashish Gupta <ashishg@marvell.com> <ashish.gupta@marvell.com> <ashish.gupta@caviumn= etworks.com>
=C2=A0Ashish Jain <ashish.jain@nxp.com>
=C2=A0Ashish Paul <apaul@juniper.net>
-Ashish Sadanandan <ashish.sadanandan@gmail.com>
+Ashish Sadanandan <ashish.sadanandan@gmail.com> <quic_asadanan@quicinc.com><= br> =C2=A0Ashish Shah <ashish.n.shah@intel.com>
=C2=A0Ashwin Sekhar T K <asekhar@marvell.com> <ashwin.sekhar@caviumnetworks.com= >
=C2=A0Asim Jamshed <asim.jamshed@gmail.com>
diff --git a/doc/guides/contributing/coding_style.rst b/doc/guides/contribu= ting/coding_style.rst
index 1ebc79ca3c..27c947fcec 100644
--- a/doc/guides/contributing/coding_style.rst
+++ b/doc/guides/contributing/coding_style.rst
@@ -106,6 +106,27 @@ Headers should be protected against multiple inclusion= with the usual:

=C2=A0 =C2=A0 #endif /* _FILE_H_ */

+Language Linkage
+~~~~~~~~~~~~~~~~
+
+Public headers should enclose all function and variable declarations and d= efinitions in an ``extern "C"`` block to facilitate interoperabil= ity with C++.
+
+.. code-block:: c
+
+=C2=A0 =C2=A0#ifndef _FILE_H_
+=C2=A0 =C2=A0#define _FILE_H_
+
+=C2=A0 =C2=A0#ifdef __cplusplus
+=C2=A0 =C2=A0extern "C" {
+=C2=A0 =C2=A0#endif
+
+=C2=A0 =C2=A0/* Code */
+
+=C2=A0 =C2=A0#ifdef __cplusplus
+=C2=A0 =C2=A0}
+=C2=A0 =C2=A0#endif
+
+=C2=A0 =C2=A0#endif /* _FILE_H_ */

=C2=A0Macros
=C2=A0~~~~~~
diff --git a/lib/eal/include/generic/rte_vect.h b/lib/eal/include/generic/r= te_vect.h
index 6540419cd2..3578d8749b 100644
--- a/lib/eal/include/generic/rte_vect.h
+++ b/lib/eal/include/generic/rte_vect.h
@@ -15,6 +15,10 @@

=C2=A0#include <stdint.h>

+#ifdef __cplusplus
+extern "C" {
+#endif
+
=C2=A0#ifndef RTE_TOOLCHAIN_MSVC

=C2=A0/* Unsigned vector types */
@@ -226,4 +230,8 @@ uint16_t rte_vect_get_max_simd_bitwidth(void);
=C2=A0 */
=C2=A0int rte_vect_set_max_simd_bitwidth(uint16_t bitwidth);

+#ifdef __cplusplus
+}
+#endif
+
=C2=A0#endif /* _RTE_VECT_H_ */
--
2.31.1

--00000000000086e4ae06151f3fb0--