Patchwork Fix gcc warning 'format not a string literal and no format arguments'

login
register
mail settings
Submitter Shahar Havivi
Date March 19, 2010, 11:11 a.m.
Message ID <20100319111123.GA16049@redhat.com>
Download mbox | patch
Permalink /patch/48137/
State New
Headers show

Comments

Shahar Havivi - March 19, 2010, 11:11 a.m.
gcc 4.4.1 produce a warning 'format not a string literal and no format 
arguments'

Signed-off-by: Shahar Havivi <shaharh@redhat.com>
---
 qemu-error.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Markus Armbruster - March 19, 2010, 12:29 p.m.
Shahar Havivi <shaharh@redhat.com> writes:

> gcc 4.4.1 produce a warning 'format not a string literal and no format 
> arguments'
>
> Signed-off-by: Shahar Havivi <shaharh@redhat.com>
> ---
>  qemu-error.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/qemu-error.c b/qemu-error.c
> index 5d5fe37..14ec14f 100644
> --- a/qemu-error.c
> +++ b/qemu-error.c
> @@ -188,7 +188,7 @@ void error_print_loc(void)
>          error_printf(" ");
>          break;
>      default:
> -        error_printf(sep);
> +        error_printf("%s", sep);
>      }
>  }

Fair enough.

Patch

diff --git a/qemu-error.c b/qemu-error.c
index 5d5fe37..14ec14f 100644
--- a/qemu-error.c
+++ b/qemu-error.c
@@ -188,7 +188,7 @@  void error_print_loc(void)
         error_printf(" ");
         break;
     default:
-        error_printf(sep);
+        error_printf("%s", sep);
     }
 }