Wireshark-dev: Re: [Wireshark-dev] Use of variadic macros
From: Alexis La Goutte <alexis.lagoutte@xxxxxxxxx>
Date: Thu, 1 Oct 2015 18:53:59 +0200
Yes, there is a "warning" with GCC from some month...

../../epan/proto.h:2740:54: warning: anonymous variadic macros were introduced in C99 [-Wvariadic-macros]

Not problem for me, to allow variadic macro !

Regards,


On Thu, Oct 1, 2015 at 6:31 PM, Graham Bloice <graham.bloice@xxxxxxxxxxxxx> wrote:

On 1 October 2015 at 17:25, Peter Wu <peter@xxxxxxxxxxxxx> wrote:
#include <stdio.h>
    #define FOO(fmt, ...) printf(fmt, #__VA_ARGS__, __VA_ARGS__)
    int main() {
      return FOO("%s test %d\n", 1);
    }

VS2013 appears to be happy, compiling the file with a .c extension:

c:\temp>cl var.c
Microsoft (R) C/C++ Optimizing Compiler Version 18.00.31101 for x86
Copyright (C) Microsoft Corporation.  All rights reserved.

var.c
Microsoft (R) Incremental Linker Version 12.00.31101.0
Copyright (C) Microsoft Corporation.  All rights reserved.

/out:var.exe
var.obj

c:\temp>.\var.exe
1 test 1


--
Graham Bloice

___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
Archives:    https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request@xxxxxxxxxxxxx?subject=unsubscribe