[PATCH sis 03/15] Fix "format not a string literal and no format arguments" compile warnings

Ander Conselvan de Oliveira conselvan2 at gmail.com
Thu Apr 14 00:29:42 PDT 2011


I sent the exact same patch a few years ago. Was enough to create an
interesting thread.

http://lists.freedesktop.org/archives/xorg/2008-December/041802.html

2011/4/6 Timo Aaltonen <tjaalton at ubuntu.com>:
> Signed-off-by: Timo Aaltonen <timo.aaltonen at canonical.com>
> ---
>  src/sis_driver.c |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/src/sis_driver.c b/src/sis_driver.c
> index 8ce1cdd..337bba6 100644
> --- a/src/sis_driver.c
> +++ b/src/sis_driver.c
> @@ -403,14 +403,14 @@ SISErrorLog(ScrnInfoPtr pScrn, const char *format, ...)
>     static const char *str = "**************************************************\n";
>
>     va_start(ap, format);
> -    xf86DrvMsg(pScrn->scrnIndex, X_ERROR, str);
> +    xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "%s", str);
>     xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
>        "                      ERROR:\n");
>     xf86VDrvMsgVerb(pScrn->scrnIndex, X_ERROR, 1, format, ap);
>     va_end(ap);
>     xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
>        "                  END OF MESSAGE\n");
> -    xf86DrvMsg(pScrn->scrnIndex, X_ERROR, str);
> +    xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "%s", str);
>  }
>
>  static void
> @@ -1888,14 +1888,14 @@ SiSUpdateXineramaScreenInfo(ScrnInfoPtr pScrn1)
>        if(infochanged && !usenonrect) {
>          xf86DrvMsg(pScrn1->scrnIndex, X_INFO,
>                        "Virtual screen size does not match maximum display modes...\n");
> -         xf86DrvMsg(pScrn1->scrnIndex, X_INFO, rectxine);
> +         xf86DrvMsg(pScrn1->scrnIndex, X_INFO, "%s", rectxine);
>
>        }
>     } else if(infochanged && usenonrect) {
>        usenonrect = FALSE;
>        xf86DrvMsg(pScrn1->scrnIndex, X_INFO,
>                "Only clone modes available for this virtual screen size...\n");
> -       xf86DrvMsg(pScrn1->scrnIndex, X_INFO, rectxine);
> +       xf86DrvMsg(pScrn1->scrnIndex, X_INFO, "%s", rectxine);
>     }
>
>     if(pSiS->maxCRT1_X1) {             /* Means we have at least one non-clone mode */
> --
> 1.7.4.1
>
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
>


More information about the xorg-devel mailing list