[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] "Enable _FORTIFY_SOURCE=2" result in building failure f
From: |
Jamie Lokier |
Subject: |
Re: [Qemu-devel] "Enable _FORTIFY_SOURCE=2" result in building failure for qemu-img.c |
Date: |
Thu, 4 Feb 2010 12:10:27 +0000 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
Sheng Yang wrote:
> printf("qemu-img version " QEMU_VERSION ", Copyright (c) 2004-2008
> Fabrice
> Bellard\n"
> "usage: qemu-img command [command options]\n"
> "QEMU disk image utility\n"
> "\n"
> "Command syntax:\n"
> #define DEF(option, callback, arg_string) \
> " " arg_string "\n"
> #include "qemu-img-cmds.h"
> #undef DEF
> #undef GEN_DOCS
> ....
>
> Seems gcc take "printf" as a marco. I added a "#undef printf" before the
> line,
> then it works...
>
> So any clue on what's happened and how to fix?
You can't have preprocessor directives inside the arguments of a macro
call. Yes it's occasionally annoying like this.
You can prevent the macro call without #undef by writing:
(printf)("qemu-img version " ...etc)
I'm not sure if Glibc is compliant with ISO C by
making printf into a macro that takes arguments.
Certain functions such as putchar() are specified as being allowed to
be macros, which implies the other standard functions aren't.
-- Jamie
- [Qemu-devel] "Enable _FORTIFY_SOURCE=2" result in building failure for qemu-img.c, Sheng Yang, 2010/02/04
- [Qemu-devel] Re: "Enable _FORTIFY_SOURCE=2" result in building failure for qemu-img.c, Paolo Bonzini, 2010/02/04
- Re: [Qemu-devel] "Enable _FORTIFY_SOURCE=2" result in building failure for qemu-img.c,
Jamie Lokier <=
- [Qemu-devel] Re: "Enable _FORTIFY_SOURCE=2" result in building failure for qemu-img.c, Juan Quintela, 2010/02/04
- [Qemu-devel] [PATCH] qemu-img: avoid preprocessor directives in a printf call, Paolo Bonzini, 2010/02/04
- [Qemu-devel] Re: [PATCH] qemu-img: avoid preprocessor directives in a printf call, Sheng Yang, 2010/02/04
- [Qemu-devel] [PATCH 0/4] Fix printf calls embedding preprocessor directives, Paolo Bonzini, 2010/02/04
- [Qemu-devel] Re: [PATCH 0/4] Fix printf calls embedding preprocessor directives, Sheng Yang, 2010/02/04
- Re: [Qemu-devel] Re: [PATCH 0/4] Fix printf calls embedding preprocessor directives, Kevin Wolf, 2010/02/05
- [Qemu-devel] Re: [PATCH 0/4] Fix printf calls embedding preprocessor directives, Paolo Bonzini, 2010/02/05
- [Qemu-devel] [PATCH 1/4] qemu-img: avoid preprocessor directives in a printf call, Paolo Bonzini, 2010/02/04
- [Qemu-devel] [PATCH 2/4] cope with printf macro definition in readline.c, Paolo Bonzini, 2010/02/04