|
|
|
|
|
|
|
|
|
|
xen-devel
Re: [Xen-devel] [PATCH RFC v2 06/13] libxl: permit declaration after sta
On Fri, 2011-10-28 at 19:37 +0100, Ian Jackson wrote:
> GCC and C99 allow declarations to be mixed with code. This is a good
> idea because:
>
> * It allows variables to be more often initialised as they are
> declared, thus reducing the occurrence of uninitialised variable
> errors.
>
> * Certain alloca-like constructs (arrays allocated at runtime on the
> stack) can more often be written without a spurious { } block.
> Such blocks are confusing to read.
>
> * It makes it easier to write and use macros which declare and
> initialise formulaic variables and do other function setup code,
> because there is no need to worry that such macros might be
> incompatible with each other or have strict ordering constraints.
>
> Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
I suspect there isn't much scope for abuse of this capability but would
a few words of guidance in CODING_STYLE make sense?
> ---
> tools/libxl/Makefile | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile
> index f23661a..a3727ab 100644
> --- a/tools/libxl/Makefile
> +++ b/tools/libxl/Makefile
> @@ -11,7 +11,8 @@ MINOR = 0
> XLUMAJOR = 1.0
> XLUMINOR = 0
>
> -CFLAGS += -Werror -Wno-format-zero-length -Wmissing-declarations
> +CFLAGS += -Werror -Wno-format-zero-length -Wmissing-declarations \
> + -Wno-declaration-after-statement
> CFLAGS += -I. -fPIC
>
> ifeq ($(CONFIG_Linux),y)
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
<Prev in Thread] |
Current Thread |
[Next in Thread>
|
- [Xen-devel] [PATCH RFC v2 09/13] libxl: introduce lock in libxl_ctx, (continued)
- Re: [Xen-devel] [PATCH RFC v2 11/13] libxl: make libxl__free_all idempotent, Ian Campbell
- Re: [Xen-devel] [PATCH RFC v2 10/13] libxl: make libxl__[v]log const-correct, Ian Campbell
- Re: [Xen-devel] [PATCH RFC v2 09/13] libxl: introduce lock in libxl_ctx, Ian Campbell
- Re: [Xen-devel] [PATCH RFC v2 08/13] libxl: Rationalise #includes, Ian Campbell
- Re: [Xen-devel] [PATCH RFC v2 07/13] libxl: internal convenience macros, Ian Campbell
- Re: [Xen-devel] [PATCH RFC v2 06/13] libxl: permit declaration after statement,
Ian Campbell <=
- Re: [Xen-devel] [PATCH RFC v2 05/13] libxl: idl: Provide struct and union tags, Ian Campbell
- Re: [Xen-devel] [PATCH RFC v2 04/13] libxl: idl: support new "c_only" type attribute, Ian Campbell
- Re: [Xen-devel] [PATCH RFC v2 03/13] libxl: Provide a version of bsd's queue.h as _libxl_list.h, Ian Campbell
- Re: [Xen-devel] [PATCH RFC v2 02/13] libxenstore: Provide xs_check_watch, Ian Campbell
Re: [Xen-devel] [PATCH RFC v2 01/13] libxl: Make libxl__xs_* more const-correct, Ian Campbell
Re: [Xen-devel] [PATCH RFC v2 00/13] New event API, Ian Campbell
|
|
|
|
|