Patchwork wmi.c: fix build error when using gcc 4.6.3

login
register
mail settings
Submitter Ivan Hu
Date Feb. 21, 2013, 6:41 a.m.
Message ID <1361428875-15976-1-git-send-email-ivan.hu@canonical.com>
Download mbox | patch
Permalink /patch/222191/
State Accepted
Headers show

Comments

Ivan Hu - Feb. 21, 2013, 6:41 a.m.
With the precise of gcc 4.6.3 version we get the build error:

acpi/wmi/wmi.c:256:2: error: expected ‘)’ before ‘PRIx8’
acpi/wmi/wmi.c:256:2: error: conversion lacks type at end of format [-Werror=format]
acpi/wmi/wmi.c:260:2: error: expected ‘)’ before ‘PRIx8’
acpi/wmi/wmi.c:260:2: error: conversion lacks type at end of format [-Werror=format]
acpi/wmi/wmi.c: In function ‘wmi_parse_wdg_data’:
acpi/wmi/wmi.c:314:4: error: expected ‘)’ before ‘PRIx8’
acpi/wmi/wmi.c:314:4: error: conversion lacks type at end of format [-Werror=format]
acpi/wmi/wmi.c:316:4: error: expected ‘)’ before ‘PRIx8’
acpi/wmi/wmi.c:316:4: error: conversion lacks type at end of format [-Werror=format]
acpi/wmi/wmi.c:318:4: error: expected ‘)’ before ‘PRIx8’
acpi/wmi/wmi.c:318:4: error: conversion lacks type at end of format [-Werror=format]
acpi/wmi/wmi.c:320:4: error: expected ‘)’ before ‘PRIx8’
acpi/wmi/wmi.c:320:4: error: conversion lacks type at end of format [-Werror=format]

because some required headers were left out.

Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
---
 src/acpi/wmi/wmi.c |    2 ++
 1 file changed, 2 insertions(+)
Keng-Yu Lin - Feb. 21, 2013, 6:50 a.m.
On Thu, Feb 21, 2013 at 2:41 PM, Ivan Hu <ivan.hu@canonical.com> wrote:
> With the precise of gcc 4.6.3 version we get the build error:
>
> acpi/wmi/wmi.c:256:2: error: expected ‘)’ before ‘PRIx8’
> acpi/wmi/wmi.c:256:2: error: conversion lacks type at end of format [-Werror=format]
> acpi/wmi/wmi.c:260:2: error: expected ‘)’ before ‘PRIx8’
> acpi/wmi/wmi.c:260:2: error: conversion lacks type at end of format [-Werror=format]
> acpi/wmi/wmi.c: In function ‘wmi_parse_wdg_data’:
> acpi/wmi/wmi.c:314:4: error: expected ‘)’ before ‘PRIx8’
> acpi/wmi/wmi.c:314:4: error: conversion lacks type at end of format [-Werror=format]
> acpi/wmi/wmi.c:316:4: error: expected ‘)’ before ‘PRIx8’
> acpi/wmi/wmi.c:316:4: error: conversion lacks type at end of format [-Werror=format]
> acpi/wmi/wmi.c:318:4: error: expected ‘)’ before ‘PRIx8’
> acpi/wmi/wmi.c:318:4: error: conversion lacks type at end of format [-Werror=format]
> acpi/wmi/wmi.c:320:4: error: expected ‘)’ before ‘PRIx8’
> acpi/wmi/wmi.c:320:4: error: conversion lacks type at end of format [-Werror=format]
>
> because some required headers were left out.
>
> Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
> ---
>  src/acpi/wmi/wmi.c |    2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/src/acpi/wmi/wmi.c b/src/acpi/wmi/wmi.c
> index 6401b41..2425be1 100644
> --- a/src/acpi/wmi/wmi.c
> +++ b/src/acpi/wmi/wmi.c
> @@ -27,6 +27,8 @@
>  #include <unistd.h>
>  #include <string.h>
>  #include <ctype.h>
> +#include <stdint.h>
> +#include <inttypes.h>
>
>  /* acpica headers */
>  #include "acpi.h"
> --
> 1.7.9.5
>
Acked-by: Keng-Yu Lin <kengyu@canonical.com>
Alex Hung - Feb. 21, 2013, 6:52 a.m.
On 02/21/2013 02:41 PM, Ivan Hu wrote:
> With the precise of gcc 4.6.3 version we get the build error:
>
> acpi/wmi/wmi.c:256:2: error: expected ‘)’ before ‘PRIx8’
> acpi/wmi/wmi.c:256:2: error: conversion lacks type at end of format [-Werror=format]
> acpi/wmi/wmi.c:260:2: error: expected ‘)’ before ‘PRIx8’
> acpi/wmi/wmi.c:260:2: error: conversion lacks type at end of format [-Werror=format]
> acpi/wmi/wmi.c: In function ‘wmi_parse_wdg_data’:
> acpi/wmi/wmi.c:314:4: error: expected ‘)’ before ‘PRIx8’
> acpi/wmi/wmi.c:314:4: error: conversion lacks type at end of format [-Werror=format]
> acpi/wmi/wmi.c:316:4: error: expected ‘)’ before ‘PRIx8’
> acpi/wmi/wmi.c:316:4: error: conversion lacks type at end of format [-Werror=format]
> acpi/wmi/wmi.c:318:4: error: expected ‘)’ before ‘PRIx8’
> acpi/wmi/wmi.c:318:4: error: conversion lacks type at end of format [-Werror=format]
> acpi/wmi/wmi.c:320:4: error: expected ‘)’ before ‘PRIx8’
> acpi/wmi/wmi.c:320:4: error: conversion lacks type at end of format [-Werror=format]
>
> because some required headers were left out.
>
> Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
> ---
>   src/acpi/wmi/wmi.c |    2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/src/acpi/wmi/wmi.c b/src/acpi/wmi/wmi.c
> index 6401b41..2425be1 100644
> --- a/src/acpi/wmi/wmi.c
> +++ b/src/acpi/wmi/wmi.c
> @@ -27,6 +27,8 @@
>   #include <unistd.h>
>   #include <string.h>
>   #include <ctype.h>
> +#include <stdint.h>
> +#include <inttypes.h>
>
>   /* acpica headers */
>   #include "acpi.h"
>
Acked-by: Alex Hung <alex.hung@canonical.com>
Colin King - Feb. 21, 2013, 8:11 a.m.
On 21/02/13 06:41, Ivan Hu wrote:
> With the precise of gcc 4.6.3 version we get the build error:
>
> acpi/wmi/wmi.c:256:2: error: expected ‘)’ before ‘PRIx8’
> acpi/wmi/wmi.c:256:2: error: conversion lacks type at end of format [-Werror=format]
> acpi/wmi/wmi.c:260:2: error: expected ‘)’ before ‘PRIx8’
> acpi/wmi/wmi.c:260:2: error: conversion lacks type at end of format [-Werror=format]
> acpi/wmi/wmi.c: In function ‘wmi_parse_wdg_data’:
> acpi/wmi/wmi.c:314:4: error: expected ‘)’ before ‘PRIx8’
> acpi/wmi/wmi.c:314:4: error: conversion lacks type at end of format [-Werror=format]
> acpi/wmi/wmi.c:316:4: error: expected ‘)’ before ‘PRIx8’
> acpi/wmi/wmi.c:316:4: error: conversion lacks type at end of format [-Werror=format]
> acpi/wmi/wmi.c:318:4: error: expected ‘)’ before ‘PRIx8’
> acpi/wmi/wmi.c:318:4: error: conversion lacks type at end of format [-Werror=format]
> acpi/wmi/wmi.c:320:4: error: expected ‘)’ before ‘PRIx8’
> acpi/wmi/wmi.c:320:4: error: conversion lacks type at end of format [-Werror=format]
>
> because some required headers were left out.
>
> Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
> ---
>   src/acpi/wmi/wmi.c |    2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/src/acpi/wmi/wmi.c b/src/acpi/wmi/wmi.c
> index 6401b41..2425be1 100644
> --- a/src/acpi/wmi/wmi.c
> +++ b/src/acpi/wmi/wmi.c
> @@ -27,6 +27,8 @@
>   #include <unistd.h>
>   #include <string.h>
>   #include <ctype.h>
> +#include <stdint.h>
> +#include <inttypes.h>
>
>   /* acpica headers */
>   #include "acpi.h"
>
Thanks for fixing my mistake.

Colin

Patch

diff --git a/src/acpi/wmi/wmi.c b/src/acpi/wmi/wmi.c
index 6401b41..2425be1 100644
--- a/src/acpi/wmi/wmi.c
+++ b/src/acpi/wmi/wmi.c
@@ -27,6 +27,8 @@ 
 #include <unistd.h>
 #include <string.h>
 #include <ctype.h>
+#include <stdint.h>
+#include <inttypes.h>
 
 /* acpica headers */
 #include "acpi.h"