[PATCH] tests: move GCC diagnostics pragma outside of function
Dave Airlie
airlied at gmail.com
Tue Aug 28 16:52:54 PDT 2012
On Wed, Aug 29, 2012 at 9:11 AM, Peter Hutterer
<peter.hutterer at who-t.net> wrote:
> This is a a gcc 4.6+ feature.
>
> signal-logging.c:210: error: #pragma GCC diagnostic not allowed inside
> functions
>
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
Required for tinderbox and EL6 builds.
Reviewed-by: Dave Airlie <airlied at redhat.com>
> ---
> Keith, I'd like this in 1.13, it breaks builds on older compilers.
>
> test/signal-logging.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/test/signal-logging.c b/test/signal-logging.c
> index 3206dde..810bd20 100644
> --- a/test/signal-logging.c
> +++ b/test/signal-logging.c
> @@ -178,6 +178,7 @@ number_formatting(void)
> assert(check_signed_number_format_test(signed_tests + i));
> }
>
> +#pragma GCC diagnostic ignored "-Wformat-security"
> static void logging_format(void)
> {
> const char *log_file_path = "/tmp/Xorg-logging-test.log";
> @@ -207,9 +208,7 @@ static void logging_format(void)
> assert(strcmp(logmsg, "(EE) test message\n") == 0);
>
> /* long buf is truncated to "....en\n" */
> -#pragma GCC diagnostic ignored "-Wformat-security"
> LogMessageVerbSigSafe(X_ERROR, -1, buf);
> -#pragma GCC diagnostic pop "-Wformat-security"
> read_log_msg(logmsg);
> assert(strcmp(&logmsg[strlen(logmsg) - 3], "en\n") == 0);
>
> @@ -298,6 +297,7 @@ static void logging_format(void)
>
> #undef read_log_msg
> }
> +#pragma GCC diagnostic pop "-Wformat-security"
>
> int
> main(int argc, char **argv)
> --
> 1.7.11.2
>
> _______________________________________________
> 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