[dpdk-dev,v2] cryptodev: fix compilation error in SUSE 11 SP2

Message ID 1475635551-121997-1-git-send-email-pablo.de.lara.guarch@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Pablo de Lara Guarch
Headers

Commit Message

De Lara Guarch, Pablo Oct. 5, 2016, 2:45 a.m. UTC
  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:70:0:
lib/librte_cryptodev/rte_cryptodev.h:772: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>
---

Changes in v2:
- Fixed commit message

 lib/librte_cryptodev/rte_cryptodev.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Adrien Mazarguil Oct. 5, 2016, 8:51 a.m. UTC | #1
On Wed, Oct 05, 2016 at 03:45:51AM +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:70:0:
> lib/librte_cryptodev/rte_cryptodev.h:772: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>
> ---
> 
> Changes in v2:
> - Fixed commit message
> 
>  lib/librte_cryptodev/rte_cryptodev.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/librte_cryptodev/rte_cryptodev.h b/lib/librte_cryptodev/rte_cryptodev.h
> index d565f39..6ad5e91 100644
> --- a/lib/librte_cryptodev/rte_cryptodev.h
> +++ b/lib/librte_cryptodev/rte_cryptodev.h
> @@ -773,7 +773,7 @@ struct rte_cryptodev_sym_session {
>  	} __rte_aligned(8);
>  	/**< Public symmetric session details */
>  
> -	char _private[];
> +	__extension__ char _private[0];
>  	/**< Private session material */
>  };
>  
> -- 
> 2.7.4

Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
  
De Lara Guarch, Pablo Oct. 6, 2016, 9 p.m. UTC | #2
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Adrien Mazarguil
> Sent: Wednesday, October 05, 2016 1:52 AM
> To: De Lara Guarch, Pablo
> Cc: dev@dpdk.org; Doherty, Declan
> Subject: Re: [dpdk-dev] [PATCH v2] cryptodev: fix compilation error in SUSE 11
> SP2
> 
> On Wed, Oct 05, 2016 at 03:45:51AM +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:70:0:
> > lib/librte_cryptodev/rte_cryptodev.h:772: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>
> > ---
> >
> > Changes in v2:
> > - Fixed commit message
> >
> >  lib/librte_cryptodev/rte_cryptodev.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/lib/librte_cryptodev/rte_cryptodev.h
> b/lib/librte_cryptodev/rte_cryptodev.h
> > index d565f39..6ad5e91 100644
> > --- a/lib/librte_cryptodev/rte_cryptodev.h
> > +++ b/lib/librte_cryptodev/rte_cryptodev.h
> > @@ -773,7 +773,7 @@ struct rte_cryptodev_sym_session {
> >  	} __rte_aligned(8);
> >  	/**< Public symmetric session details */
> >
> > -	char _private[];
> > +	__extension__ char _private[0];
> >  	/**< Private session material */
> >  };
> >
> > --
> > 2.7.4
> 
> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>

Applied to dpdk-next-crypto.

Pablo
  

Patch

diff --git a/lib/librte_cryptodev/rte_cryptodev.h b/lib/librte_cryptodev/rte_cryptodev.h
index d565f39..6ad5e91 100644
--- a/lib/librte_cryptodev/rte_cryptodev.h
+++ b/lib/librte_cryptodev/rte_cryptodev.h
@@ -773,7 +773,7 @@  struct rte_cryptodev_sym_session {
 	} __rte_aligned(8);
 	/**< Public symmetric session details */
 
-	char _private[];
+	__extension__ char _private[0];
 	/**< Private session material */
 };