DPDK patches and discussions
 help / color / mirror / Atom feed
From: "De Lara Guarch, Pablo" <pablo.de.lara.guarch@intel.com>
To: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	"Doherty, Declan" <declan.doherty@intel.com>
Subject: Re: [dpdk-dev] [PATCH] cryptodev: fix compilation error in SUSE 11 SP2
Date: Thu, 29 Sep 2016 19:30:31 +0000	[thread overview]
Message-ID: <E115CCD9D858EF4F90C690B0DCB4D8973CA02375@IRSMSX108.ger.corp.intel.com> (raw)
In-Reply-To: <20160927074521.GY17252@6wind.com>



> -----Original Message-----
> From: Adrien Mazarguil [mailto:adrien.mazarguil@6wind.com]
> Sent: Tuesday, September 27, 2016 12:45 AM
> To: De Lara Guarch, Pablo
> Cc: dev@dpdk.org; Doherty, Declan
> Subject: Re: [PATCH] cryptodev: fix compilation error in SUSE 11 SP2
> 
> On Mon, Sep 26, 2016 at 10:50:35PM +0100, Pablo de Lara wrote:
> > This commit fixes following build error, which happens in SUSE 11 SP2,
> > with gcc 4.5.1:
> >
> > In file included from lib/librte_cryptodev/rte_cryptodev.c:71:0:
> > lib/librte_cryptodev/rte_cryptodev_pmd.h:76:7:
> > error: flexible array member in otherwise empty struct
> >
> > Fixes: 347a1e037fd3 ("lib: use C99 syntax for zero-size arrays")
> >
> > Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
> 
> Hmm, this error message does not seem related to your patch. Assuming a
> similar error is caused by the original code, I think there is a more
> important issue as the struct should not be empty. Can you check the
> error?

Well, I don't really understand what is the difference between array[] and array[0],
I thought both were the same, but some compilers only accept the latter.
In any case, the struct will not be empty, as there are other fields, that are not variable sized.

I saw that in your patch you made these two changes (among others):

diff --git a/lib/librte_cryptodev/rte_cryptodev.h b/lib/librte_cryptodev/rte_cryptodev.h
index affbdec..1e30a19 100644
--- a/lib/librte_cryptodev/rte_cryptodev.h
+++ b/lib/librte_cryptodev/rte_cryptodev.h
@@ -759,7 +759,7 @@ struct rte_cryptodev_sym_session {
        } __rte_aligned(8);
        /**< Public symmetric session details */

-       char _private[0];
+       char _private[];
        /**< Private session material */
 };

diff --git a/lib/librte_cryptodev/rte_cryptodev_pmd.h b/lib/librte_cryptodev/rte_cryptodev_pmd.h
index 7d049ea..42e7b79 100644
--- a/lib/librte_cryptodev/rte_cryptodev_pmd.h
+++ b/lib/librte_cryptodev/rte_cryptodev_pmd.h
@@ -71,7 +71,7 @@ struct rte_cryptodev_session {
                struct rte_mempool *mp;
        } __rte_aligned(8);

-       char _private[0];
+       __extension__ char _private[0];
 };

So I would expect the same change in both, as they are almost identical,
but you took different approaches (do you know why? I would like to know :))

Basically, I noticed that gcc 4.5 doesn't complain when using your second approach,
that's why I changed it.

Thanks,
Pablo

  reply	other threads:[~2016-09-29 19:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-26 21:50 Pablo de Lara
2016-09-27  7:45 ` Adrien Mazarguil
2016-09-29 19:30   ` De Lara Guarch, Pablo [this message]
2016-09-30  8:33     ` Adrien Mazarguil
2016-10-05  2:31       ` De Lara Guarch, Pablo
2016-10-05  2:45 ` [dpdk-dev] [PATCH v2] " Pablo de Lara
2016-10-05  8:51   ` Adrien Mazarguil
2016-10-06 21:00     ` De Lara Guarch, Pablo

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=E115CCD9D858EF4F90C690B0DCB4D8973CA02375@IRSMSX108.ger.corp.intel.com \
    --to=pablo.de.lara.guarch@intel.com \
    --cc=adrien.mazarguil@6wind.com \
    --cc=declan.doherty@intel.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).