From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcel Heinz Subject: [PTACH] libcacard: fix VCARD_ATTR_PREFIX macro Date: Sun, 18 Mar 2012 18:41:18 +0100 Message-ID: <4F661E3E.60007@informatik.tu-chemnitz.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: kvm@vger.kernel.org Return-path: Received: from nick.hrz.tu-chemnitz.de ([134.109.228.11]:59713 "EHLO nick.hrz.tu-chemnitz.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755973Ab2CRSFd (ORCPT ); Sun, 18 Mar 2012 14:05:33 -0400 Sender: kvm-owner@vger.kernel.org List-ID: Hi, i just tried to compile lastest git HEAD and ran into the following problem: vcard_emul_nss.c:528:1: error: initializer element is not constant The source code is: static const unsigned char nss_atr[] = { VCARD_ATR_PREFIX(3), 'N', 'S', 'S' }; with #define VCARD_ATR_PREFIX(size) (0x3b, 0x68+(size), 0x00, 0xff, \ 'V', 'C', 'A', 'R', 'D', '_') The parentheses in this macro result in the use of the comma operator in the initialization and are clearly not correct. This is a regression from commit 0082f4336e128a17d5f34e01de0fd29930e99b0d, which changed 0x66+(size) to 0x68+size and added the parenthesis. So I propose the following patch: 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 { Regards, Marcel