qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] libcacard: Fix compilation with gcc-4.7
@ 2012-03-02 15:49 Hans de Goede
  2012-03-03  1:44 ` Brad Smith
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Hans de Goede @ 2012-03-02 15:49 UTC (permalink / raw)
  To: qemu-devel; +Cc: Hans de Goede

VCARD_ATR_PREFIX is used as part of an array initializer so it should
not have () around it, so far this happened to work, but gcc-4.7 does
not like it.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 libcacard/vcardt.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libcacard/vcardt.h b/libcacard/vcardt.h
index d4d8e2e..d3e9522 100644
--- a/libcacard/vcardt.h
+++ b/libcacard/vcardt.h
@@ -26,8 +26,8 @@ typedef struct VCardEmulStruct VCardEmul;
 #define MAX_CHANNEL 4
 
 /* create an ATR with appropriate historical bytes */
-#define VCARD_ATR_PREFIX(size) (0x3b, 0x68+(size), 0x00, 0xff, \
-                               'V', 'C', 'A', 'R', 'D', '_')
+#define VCARD_ATR_PREFIX(size) 0x3b, 0x68+(size), 0x00, 0xff, \
+                               'V', 'C', 'A', 'R', 'D', '_'
 
 
 typedef enum {
-- 
1.7.7.6

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH] libcacard: Fix compilation with gcc-4.7
  2012-03-02 15:49 [Qemu-devel] [PATCH] libcacard: Fix compilation with gcc-4.7 Hans de Goede
@ 2012-03-03  1:44 ` Brad Smith
  2012-03-05 12:47   ` Alon Levy
  2012-03-05 13:06 ` Michal Privoznik
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Brad Smith @ 2012-03-03  1:44 UTC (permalink / raw)
  To: Hans de Goede; +Cc: Alon Levy, qemu-devel, Gerd Hoffmann

On 02/03/12 10:49 AM, Hans de Goede wrote:
> VCARD_ATR_PREFIX is used as part of an array initializer so it should
> not have () around it, so far this happened to work, but gcc-4.7 does
> not like it.

This recent commit..

libcacard: fix reported ATR length

Broke the build on my OpenBSD (gcc 4.2.1) buildbot which was due to the
change to this macro.

vcard_emul_nss.c:528: warning: left-hand operand of comma expression has 
no effect
vcard_emul_nss.c:528: warning: left-hand operand of comma expression has 
no effect
vcard_emul_nss.c:528: warning: left-hand operand of comma expression has 
no effect
vcard_emul_nss.c:528: warning: left-hand operand of comma expression has 
no effect
vcard_emul_nss.c:528: warning: left-hand operand of comma expression has 
no effect
vcard_emul_nss.c:528: warning: left-hand operand of comma expression has 
no effect
vcard_emul_nss.c:528: warning: left-hand operand of comma expression has 
no effect
vcard_emul_nss.c:528: warning: left-hand operand of comma expression has 
no effect
vcard_emul_nss.c:528: warning: left-hand operand of comma expression has 
no effect
vcard_emul_nss.c:528: error: initializer element is not constant
vcard_emul_nss.c:528: error: (near initialization for 'nss_atr[0]')
gmake[1]: *** [vcard_emul_nss.o] Error 1

> Signed-off-by: Hans de Goede<hdegoede@redhat.com>
> ---
>   libcacard/vcardt.h |    4 ++--
>   1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libcacard/vcardt.h b/libcacard/vcardt.h
> index d4d8e2e..d3e9522 100644
> --- a/libcacard/vcardt.h
> +++ b/libcacard/vcardt.h
> @@ -26,8 +26,8 @@ typedef struct VCardEmulStruct VCardEmul;
>   #define MAX_CHANNEL 4
>
>   /* create an ATR with appropriate historical bytes */
> -#define VCARD_ATR_PREFIX(size) (0x3b, 0x68+(size), 0x00, 0xff, \
> -                               'V', 'C', 'A', 'R', 'D', '_')
> +#define VCARD_ATR_PREFIX(size) 0x3b, 0x68+(size), 0x00, 0xff, \
> +                               'V', 'C', 'A', 'R', 'D', '_'
>
>
>   typedef enum {

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH] libcacard: Fix compilation with gcc-4.7
  2012-03-03  1:44 ` Brad Smith
@ 2012-03-05 12:47   ` Alon Levy
  2012-03-05 12:50     ` Alon Levy
  0 siblings, 1 reply; 7+ messages in thread
From: Alon Levy @ 2012-03-05 12:47 UTC (permalink / raw)
  To: Brad Smith; +Cc: Hans de Goede, qemu-devel, Gerd Hoffmann

On Fri, Mar 02, 2012 at 08:44:09PM -0500, Brad Smith wrote:
> On 02/03/12 10:49 AM, Hans de Goede wrote:
> >VCARD_ATR_PREFIX is used as part of an array initializer so it should
> >not have () around it, so far this happened to work, but gcc-4.7 does
> >not like it.
> 

Thanks for the report, my bad, used a different version of vcardt.h for
compilation probably. This breaks on linux as well with gcc 4.7.0 .

> This recent commit..
> 
> libcacard: fix reported ATR length
> 
> Broke the build on my OpenBSD (gcc 4.2.1) buildbot which was due to the
> change to this macro.
> 
> vcard_emul_nss.c:528: warning: left-hand operand of comma expression
> has no effect
> vcard_emul_nss.c:528: warning: left-hand operand of comma expression
> has no effect
> vcard_emul_nss.c:528: warning: left-hand operand of comma expression
> has no effect
> vcard_emul_nss.c:528: warning: left-hand operand of comma expression
> has no effect
> vcard_emul_nss.c:528: warning: left-hand operand of comma expression
> has no effect
> vcard_emul_nss.c:528: warning: left-hand operand of comma expression
> has no effect
> vcard_emul_nss.c:528: warning: left-hand operand of comma expression
> has no effect
> vcard_emul_nss.c:528: warning: left-hand operand of comma expression
> has no effect
> vcard_emul_nss.c:528: warning: left-hand operand of comma expression
> has no effect
> vcard_emul_nss.c:528: error: initializer element is not constant
> vcard_emul_nss.c:528: error: (near initialization for 'nss_atr[0]')
> gmake[1]: *** [vcard_emul_nss.o] Error 1
> 
> >Signed-off-by: Hans de Goede<hdegoede@redhat.com>
> >---
> >  libcacard/vcardt.h |    4 ++--
> >  1 files changed, 2 insertions(+), 2 deletions(-)
> >
> >diff --git a/libcacard/vcardt.h b/libcacard/vcardt.h
> >index d4d8e2e..d3e9522 100644
> >--- a/libcacard/vcardt.h
> >+++ b/libcacard/vcardt.h
> >@@ -26,8 +26,8 @@ typedef struct VCardEmulStruct VCardEmul;
> >  #define MAX_CHANNEL 4
> >
> >  /* create an ATR with appropriate historical bytes */
> >-#define VCARD_ATR_PREFIX(size) (0x3b, 0x68+(size), 0x00, 0xff, \
> >-                               'V', 'C', 'A', 'R', 'D', '_')
> >+#define VCARD_ATR_PREFIX(size) 0x3b, 0x68+(size), 0x00, 0xff, \
> >+                               'V', 'C', 'A', 'R', 'D', '_'
> >
> >
> >  typedef enum {
> 
> -- 
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
> 
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH] libcacard: Fix compilation with gcc-4.7
  2012-03-05 12:47   ` Alon Levy
@ 2012-03-05 12:50     ` Alon Levy
  0 siblings, 0 replies; 7+ messages in thread
From: Alon Levy @ 2012-03-05 12:50 UTC (permalink / raw)
  To: Brad Smith, Hans de Goede, qemu-devel, Gerd Hoffmann

On Mon, Mar 05, 2012 at 02:47:13PM +0200, Alon Levy wrote:
> On Fri, Mar 02, 2012 at 08:44:09PM -0500, Brad Smith wrote:
> > On 02/03/12 10:49 AM, Hans de Goede wrote:
> > >VCARD_ATR_PREFIX is used as part of an array initializer so it should
> > >not have () around it, so far this happened to work, but gcc-4.7 does
> > >not like it.
> > 
> 
> Thanks for the report, my bad, used a different version of vcardt.h for
> compilation probably. This breaks on linux as well with gcc 4.7.0 .

Please ignore the previous email.

> 
> > This recent commit..
> > 
> > libcacard: fix reported ATR length
> > 
> > Broke the build on my OpenBSD (gcc 4.2.1) buildbot which was due to the
> > change to this macro.
> > 
> > vcard_emul_nss.c:528: warning: left-hand operand of comma expression
> > has no effect
> > vcard_emul_nss.c:528: warning: left-hand operand of comma expression
> > has no effect
> > vcard_emul_nss.c:528: warning: left-hand operand of comma expression
> > has no effect
> > vcard_emul_nss.c:528: warning: left-hand operand of comma expression
> > has no effect
> > vcard_emul_nss.c:528: warning: left-hand operand of comma expression
> > has no effect
> > vcard_emul_nss.c:528: warning: left-hand operand of comma expression
> > has no effect
> > vcard_emul_nss.c:528: warning: left-hand operand of comma expression
> > has no effect
> > vcard_emul_nss.c:528: warning: left-hand operand of comma expression
> > has no effect
> > vcard_emul_nss.c:528: warning: left-hand operand of comma expression
> > has no effect
> > vcard_emul_nss.c:528: error: initializer element is not constant
> > vcard_emul_nss.c:528: error: (near initialization for 'nss_atr[0]')
> > gmake[1]: *** [vcard_emul_nss.o] Error 1
> > 
> > >Signed-off-by: Hans de Goede<hdegoede@redhat.com>
> > >---
> > >  libcacard/vcardt.h |    4 ++--
> > >  1 files changed, 2 insertions(+), 2 deletions(-)
> > >
> > >diff --git a/libcacard/vcardt.h b/libcacard/vcardt.h
> > >index d4d8e2e..d3e9522 100644
> > >--- a/libcacard/vcardt.h
> > >+++ b/libcacard/vcardt.h
> > >@@ -26,8 +26,8 @@ typedef struct VCardEmulStruct VCardEmul;
> > >  #define MAX_CHANNEL 4
> > >
> > >  /* create an ATR with appropriate historical bytes */
> > >-#define VCARD_ATR_PREFIX(size) (0x3b, 0x68+(size), 0x00, 0xff, \
> > >-                               'V', 'C', 'A', 'R', 'D', '_')
> > >+#define VCARD_ATR_PREFIX(size) 0x3b, 0x68+(size), 0x00, 0xff, \
> > >+                               'V', 'C', 'A', 'R', 'D', '_'
> > >
> > >
> > >  typedef enum {
> > 
> > -- 
> > This message has been scanned for viruses and
> > dangerous content by MailScanner, and is
> > believed to be clean.
> > 
> > 
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH] libcacard: Fix compilation with gcc-4.7
  2012-03-02 15:49 [Qemu-devel] [PATCH] libcacard: Fix compilation with gcc-4.7 Hans de Goede
  2012-03-03  1:44 ` Brad Smith
@ 2012-03-05 13:06 ` Michal Privoznik
  2012-03-06 13:31 ` Alon Levy
  2012-03-09 19:27 ` Anthony Liguori
  3 siblings, 0 replies; 7+ messages in thread
From: Michal Privoznik @ 2012-03-05 13:06 UTC (permalink / raw)
  To: Hans de Goede; +Cc: qemu-devel

On 02.03.2012 16:49, Hans de Goede wrote:
> VCARD_ATR_PREFIX is used as part of an array initializer so it should
> not have () around it, so far this happened to work, but gcc-4.7 does
> not like it.

Neither do gcc-4.6.2.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH] libcacard: Fix compilation with gcc-4.7
  2012-03-02 15:49 [Qemu-devel] [PATCH] libcacard: Fix compilation with gcc-4.7 Hans de Goede
  2012-03-03  1:44 ` Brad Smith
  2012-03-05 13:06 ` Michal Privoznik
@ 2012-03-06 13:31 ` Alon Levy
  2012-03-09 19:27 ` Anthony Liguori
  3 siblings, 0 replies; 7+ messages in thread
From: Alon Levy @ 2012-03-06 13:31 UTC (permalink / raw)
  To: Anthony Liguori, Hans de Goede; +Cc: qemu-devel

On Fri, Mar 02, 2012 at 04:49:44PM +0100, Hans de Goede wrote:

Ack. Anthony, this breaks build for libcacard, caused by my last commit
to the same file as Brad noted:

    commit 0082f4336e128a17d5f34e01de0fd29930e99b0d
    Author: Alon Levy <alevy@redhat.com>
    Date:   Sun Feb 26 17:09:24 2012 +0100

        libcacard: fix reported ATR length

Can you apply?

Thanks,
Alon

> VCARD_ATR_PREFIX is used as part of an array initializer so it should
> not have () around it, so far this happened to work, but gcc-4.7 does
> not like it.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
>  libcacard/vcardt.h |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libcacard/vcardt.h b/libcacard/vcardt.h
> index d4d8e2e..d3e9522 100644
> --- a/libcacard/vcardt.h
> +++ b/libcacard/vcardt.h
> @@ -26,8 +26,8 @@ typedef struct VCardEmulStruct VCardEmul;
>  #define MAX_CHANNEL 4
>  
>  /* create an ATR with appropriate historical bytes */
> -#define VCARD_ATR_PREFIX(size) (0x3b, 0x68+(size), 0x00, 0xff, \
> -                               'V', 'C', 'A', 'R', 'D', '_')
> +#define VCARD_ATR_PREFIX(size) 0x3b, 0x68+(size), 0x00, 0xff, \
> +                               'V', 'C', 'A', 'R', 'D', '_'
>  
>  
>  typedef enum {
> -- 
> 1.7.7.6
> 
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH] libcacard: Fix compilation with gcc-4.7
  2012-03-02 15:49 [Qemu-devel] [PATCH] libcacard: Fix compilation with gcc-4.7 Hans de Goede
                   ` (2 preceding siblings ...)
  2012-03-06 13:31 ` Alon Levy
@ 2012-03-09 19:27 ` Anthony Liguori
  3 siblings, 0 replies; 7+ messages in thread
From: Anthony Liguori @ 2012-03-09 19:27 UTC (permalink / raw)
  To: Hans de Goede; +Cc: qemu-devel

On 03/02/2012 09:49 AM, Hans de Goede wrote:
> VCARD_ATR_PREFIX is used as part of an array initializer so it should
> not have () around it, so far this happened to work, but gcc-4.7 does
> not like it.
>
> Signed-off-by: Hans de Goede<hdegoede@redhat.com>

Applied.  Thanks.

Regards,

Anthony Liguori

> ---
>   libcacard/vcardt.h |    4 ++--
>   1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libcacard/vcardt.h b/libcacard/vcardt.h
> index d4d8e2e..d3e9522 100644
> --- a/libcacard/vcardt.h
> +++ b/libcacard/vcardt.h
> @@ -26,8 +26,8 @@ typedef struct VCardEmulStruct VCardEmul;
>   #define MAX_CHANNEL 4
>
>   /* create an ATR with appropriate historical bytes */
> -#define VCARD_ATR_PREFIX(size) (0x3b, 0x68+(size), 0x00, 0xff, \
> -                               'V', 'C', 'A', 'R', 'D', '_')
> +#define VCARD_ATR_PREFIX(size) 0x3b, 0x68+(size), 0x00, 0xff, \
> +                               'V', 'C', 'A', 'R', 'D', '_'
>
>
>   typedef enum {

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-03-09 19:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-02 15:49 [Qemu-devel] [PATCH] libcacard: Fix compilation with gcc-4.7 Hans de Goede
2012-03-03  1:44 ` Brad Smith
2012-03-05 12:47   ` Alon Levy
2012-03-05 12:50     ` Alon Levy
2012-03-05 13:06 ` Michal Privoznik
2012-03-06 13:31 ` Alon Levy
2012-03-09 19:27 ` Anthony Liguori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).