diff mbox series

[3/3] lib: fix gcc 8 warning messages

Message ID 1532498172-20527-3-git-send-email-alex.hung@canonical.com
State Accepted
Headers show
Series [1/3] lib: fix array size too small to fit the output | expand

Commit Message

Alex Hung July 25, 2018, 5:56 a.m. UTC
This is to fix gcc 8 complains of "struct <anonymous>’ is less than 8
[-Werror=packed-not-aligned]"

Signed-off-by: Alex Hung <alex.hung@canonical.com>
---
 src/lib/include/fwts_uefi.h | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Ivan Hu July 26, 2018, 7:43 a.m. UTC | #1
On 07/25/2018 01:56 PM, Alex Hung wrote:
> This is to fix gcc 8 complains of "struct <anonymous>’ is less than 8
> [-Werror=packed-not-aligned]"
>
> Signed-off-by: Alex Hung <alex.hung@canonical.com>
> ---
>  src/lib/include/fwts_uefi.h | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/src/lib/include/fwts_uefi.h b/src/lib/include/fwts_uefi.h
> index e90d115..686af8d 100644
> --- a/src/lib/include/fwts_uefi.h
> +++ b/src/lib/include/fwts_uefi.h
> @@ -20,6 +20,11 @@
>  #ifndef __FWTS_UEFI_H__
>  #define __FWTS_UEFI_H__
>  
> +#if defined(__GNUC__) && (__GNUC__ > 7)
> +_Pragma("GCC diagnostic push")
> +_Pragma("GCC diagnostic ignored \"-Wpacked-not-aligned\"")
> +#endif
> +
>  #define FWTS_UEFI_LOAD_OPTION_ACTIVE 		0x00000001
>  #define FWTS_UEFI_LOAD_OPTION_FORCE_RECONNECT 	0x00000002
>  
> @@ -656,4 +661,8 @@ char *fwts_uefi_attribute_info(uint32_t attr);
>  
>  bool fwts_uefi_efivars_iface_exist(void);
>  
> +#if defined(__GNUC__) && (__GNUC__ > 7)
> +_Pragma("GCC diagnostic pop")
> +#endif
> +
>  #endif

Acked-by: Ivan Hu <ivan.hu@canonical.com>
Colin Ian King July 30, 2018, 5:52 a.m. UTC | #2
On 25/07/18 06:56, Alex Hung wrote:
> This is to fix gcc 8 complains of "struct <anonymous>’ is less than 8
> [-Werror=packed-not-aligned]"
> 
> Signed-off-by: Alex Hung <alex.hung@canonical.com>
> ---
>  src/lib/include/fwts_uefi.h | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/src/lib/include/fwts_uefi.h b/src/lib/include/fwts_uefi.h
> index e90d115..686af8d 100644
> --- a/src/lib/include/fwts_uefi.h
> +++ b/src/lib/include/fwts_uefi.h
> @@ -20,6 +20,11 @@
>  #ifndef __FWTS_UEFI_H__
>  #define __FWTS_UEFI_H__
>  
> +#if defined(__GNUC__) && (__GNUC__ > 7)
> +_Pragma("GCC diagnostic push")
> +_Pragma("GCC diagnostic ignored \"-Wpacked-not-aligned\"")
> +#endif
> +
>  #define FWTS_UEFI_LOAD_OPTION_ACTIVE 		0x00000001
>  #define FWTS_UEFI_LOAD_OPTION_FORCE_RECONNECT 	0x00000002
>  
> @@ -656,4 +661,8 @@ char *fwts_uefi_attribute_info(uint32_t attr);
>  
>  bool fwts_uefi_efivars_iface_exist(void);
>  
> +#if defined(__GNUC__) && (__GNUC__ > 7)
> +_Pragma("GCC diagnostic pop")
> +#endif
> +
>  #endif
> 
Acked-by: Colin Ian King <colin.king@canonical.com>
diff mbox series

Patch

diff --git a/src/lib/include/fwts_uefi.h b/src/lib/include/fwts_uefi.h
index e90d115..686af8d 100644
--- a/src/lib/include/fwts_uefi.h
+++ b/src/lib/include/fwts_uefi.h
@@ -20,6 +20,11 @@ 
 #ifndef __FWTS_UEFI_H__
 #define __FWTS_UEFI_H__
 
+#if defined(__GNUC__) && (__GNUC__ > 7)
+_Pragma("GCC diagnostic push")
+_Pragma("GCC diagnostic ignored \"-Wpacked-not-aligned\"")
+#endif
+
 #define FWTS_UEFI_LOAD_OPTION_ACTIVE 		0x00000001
 #define FWTS_UEFI_LOAD_OPTION_FORCE_RECONNECT 	0x00000002
 
@@ -656,4 +661,8 @@  char *fwts_uefi_attribute_info(uint32_t attr);
 
 bool fwts_uefi_efivars_iface_exist(void);
 
+#if defined(__GNUC__) && (__GNUC__ > 7)
+_Pragma("GCC diagnostic pop")
+#endif
+
 #endif