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 66D3F43E1F for ; Sun, 7 Apr 2024 03:31:07 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 54B5D402E7; Sun, 7 Apr 2024 03:31:07 +0200 (CEST) Received: from mail-ed1-f49.google.com (mail-ed1-f49.google.com [209.85.208.49]) by mails.dpdk.org (Postfix) with ESMTP id 5E5A840299; Sun, 7 Apr 2024 03:31:05 +0200 (CEST) Received: by mail-ed1-f49.google.com with SMTP id 4fb4d7f45d1cf-56e37503115so1391468a12.1; Sat, 06 Apr 2024 18:31:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712453465; x=1713058265; 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=HXhWDOTJ35dJNkffpW58i0un7+FNsiFGJGYcgTytm8M=; b=nQJiFZDNwAwy7P9WY0a716r3H/tHldNH4iDRAf8x9487lm4U6pI7xurcMRhWZLHBAT +bCbX+8VW9fKRwCbfvshc5xJ6gjMjZoh7lbVwL/8QG/J1qarnmB68vNqwIroKnkBigh7 ZMw6+iAQVzMsfHZ0si07x+GfXSd5JmtSbZkvcMVLPOSDJ6GRyLsV57ElMq27x/HEe8Jk GxIRT1mbC60Rk6j0DNTRmGpoPiNEe3A6dN5xh842SvhPM2Bmhb9QJvBCrOpyUgqYEHi1 ismZ2sxhItjCRq6b6lP3o3dCbvdeJSN6rKDGGmfqJsOeZTjx6s8LNAkIB5HjKnOHa6Me 0yow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712453465; x=1713058265; 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=HXhWDOTJ35dJNkffpW58i0un7+FNsiFGJGYcgTytm8M=; b=iD8EwwW+ZFEJW5Fnu1YnWO3K8UyPF+/GWmthWL2uSWCz7b8JW7z2/f7UenzO9qmoIe CV5JuZOjzOoPfQ8MP6lfPo5quOQgbZiGamR8hjWIHKhkWVRGo/S3SNuMdMkfA3Mr90U1 3KgGXwvSEplQYrpy2lJ0Fk1hoIU4+tE6p9JC6T+Lyv3vTtkJIgBoLrswmMvpbWfan+qh aDRPrpM61+QMTZ3k/0BEt7ctsh3vcwHM9sh27TC4j3b/XAzSkairqJxQJyCpKufKKtME IWRFr8lI4g5JPqFQCPEyYohVnppbkF+rRMNjqCmv6sZ5AGQS2Cf0bnZNfcwGWQuiupRo MxNA== X-Forwarded-Encrypted: i=1; AJvYcCUnzgolX1JeRtmAA9aP7cNLNhV6toBYY6XnmBYzqaYpAiF6RTZQUozfjgjPdDlqC0A8F8yRUzQLoJNOHTXJmD4= X-Gm-Message-State: AOJu0Yxktajs48kwzCEezgHWfuc9u9DNUYFZZmfJ5V2YZBnmCHPzSRjm nLueABvok1+CLeEf03GLGgxGhFmQ+1v3RfA7BgEmqonjhd/BJKon4PkM4CWZHeOsLxv1UpFe9RD hji+l8sOBa7Jx1BYqh7qR/ELjFOM= X-Google-Smtp-Source: AGHT+IHDJhJY92KGe0TcNLx0mYIi2cpBX2v4Fko2P8kgdgUQViXtjIVrpkpSPCEMQ1TCTp/nwBUxcGbxRDxWS/GQvjA= X-Received: by 2002:a50:d587:0:b0:56e:df1:53e2 with SMTP id v7-20020a50d587000000b0056e0df153e2mr3781184edi.22.1712453464644; Sat, 06 Apr 2024 18:31:04 -0700 (PDT) MIME-Version: 1.0 References: <20240202051335.776290-1-ashish.sadanandan@gmail.com> <20240318024415.555614-1-ashish.sadanandan@gmail.com> <1836105.FMhQkTaH9n@thomas> In-Reply-To: <1836105.FMhQkTaH9n@thomas> From: Ashish Sadanandan Date: Sat, 6 Apr 2024 19:30:38 -0600 Message-ID: Subject: Re: [PATCH v3 1/1] eal: add C++ include guard in generic/rte_vect.h To: Thomas Monjalon Cc: dev@dpdk.org, nelio.laranjeiro@6wind.com, stable@dpdk.org Content-Type: multipart/alternative; boundary="0000000000007460a2061577a44a" X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org --0000000000007460a2061577a44a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Apr 3, 2024 at 8:52=E2=80=AFAM Thomas Monjalon wrote: > 02/04/2024 18:03, Ashish Sadanandan: > > 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 correctl= y, > > I've always had trouble with that part. > > I remember we were discussing about aligning all files. > I was waiting for a patch applying the rule we discussed. > > I missed the part where people were volunteering me for additional work := ) The consensus seems to be that the extern "C" directives should only be in public headers, not private ones. Can you please tell me if there's an easy way to get a list of public headers? > > 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(-) > > > > > > --- a/doc/guides/contributing/coding_style.rst > > > +++ b/doc/guides/contributing/coding_style.rst > > > +Language Linkage > > > +~~~~~~~~~~~~~~~~ > > > + > > > +Public headers should enclose all function and variable declarations > and > > > definitions in an ``extern "C"`` block to facilitate interoperability > with > > > C++. > > > + > > > +.. code-block:: c > > > + > > > + #ifndef _FILE_H_ > > > + #define _FILE_H_ > > > + > > > + #ifdef __cplusplus > > > + extern "C" { > > > + #endif > > > + > > > + /* Code */ > > > + > > > + #ifdef __cplusplus > > > + } > > > + #endif > > > + > > > + #endif /* _FILE_H_ */ > > This is not describing where the includes should be placed. > Will address this along with the rest of the headers. Regards, Ashish. --0000000000007460a2061577a44a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Wed, Apr 3, 2024 at 8:52=E2=80=AFA= M Thomas Monjalon <thomas@monjalo= n.net> wrote:
02/04/2024 18:03, Ashish Sadanandan:
> Hi everyone,
> I've made the updates as suggested. Could someone please review th= e latest
> patchset? Not sure if I followed the new patchset instructions correct= ly,
> I've always had trouble with that part.

I remember we were discussing about aligning all files.
I was waiting for a patch applying the rule we discussed.

I missed the part where people were volunteering me f= or additional work :)

The consensus seems to be th= at the extern "C" directives should only be in public headers, no= t private ones. Can you please tell me if there's an easy way to get a = list of public headers?=C2=A0


> On Sun, Mar 17, 2024 at 8:44=E2=80=AFPM Ashish Sadanandan <
> ashis= h.sadanandan@gmail.com> wrote:
>
> > The header was missing the extern "C" directive which c= auses name
> > mangling of functions by C++ compilers, leading to linker errors<= br> > > 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@d= pdk.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=A0 doc/guides/contributing/coding_style.rst | 21 +++++++++++++= ++++++++
> >=C2=A0 lib/eal/include/generic/rte_vect.h=C2=A0 =C2=A0 =C2=A0 =C2= =A0|=C2=A0 8 ++++++++
> >=C2=A0 3 files changed, 30 insertions(+), 1 deletion(-)
> >
> > --- a/doc/guides/contributing/coding_style.rst
> > +++ b/doc/guides/contributing/coding_style.rst
> > +Language Linkage
> > +~~~~~~~~~~~~~~~~
> > +
> > +Public headers should enclose all function and variable declarat= ions and
> > definitions in an ``extern "C"`` block to facilitate in= teroperability 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_ */

This is not describing where the includes should be placed.
=C2=A0
Will address this along with the rest of the headers.

Regards,
Ashish.
--0000000000007460a2061577a44a--