From patchwork Thu Mar 13 11:31:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 26201 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f197.google.com (mail-qc0-f197.google.com [209.85.216.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8B284203AC for ; Thu, 13 Mar 2014 11:31:51 +0000 (UTC) Received: by mail-qc0-f197.google.com with SMTP id i8sf1980757qcq.0 for ; Thu, 13 Mar 2014 04:31:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=pxWk2E5V+tgiuN/k+ns9w/ZXFidSG6+i5oMWFNC0YC8=; b=GM51w5qBFf3+7NI8RIHEC6IK/KPPvF4ZaYHc/RwwSLJGdv1WlTnv/r+jLeJuY1Z/zL 7PQkPH7BrHDsdtTMJcMriQfQydBLfOZn3InOSAZ3Q49B/FkEEt/cCskpJZJAGyx3m4q8 uHoTCGmvGIB5OIJJGUG8Adf2HCj52944TDwgrrpdj2iv7/5q+UOp8g6dsCI5gdX53ksn gg/0Gl69jrxzqzUOrkEpYMwtA0pfoxD/O9YuybHr78hItnLOmqX+pCHzUPx/E4C2kQBy fqgw5CfLDu+8irb/UT1XWnzS4EKKMaD7DFtePI4KasobpvF5/szvRItclH6bNoZ0+Oaz 9qaA== X-Gm-Message-State: ALoCoQlfoHAyHhqClyRtgz8zF8H1jJZSTA6BZThpZu7Yeufv2x0DmzCmiCC+wdSOoYnl1pPp7TMZ X-Received: by 10.52.28.116 with SMTP id a20mr467342vdh.2.1394710311325; Thu, 13 Mar 2014 04:31:51 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.87.33 with SMTP id q30ls240376qgd.99.gmail; Thu, 13 Mar 2014 04:31:51 -0700 (PDT) X-Received: by 10.58.185.145 with SMTP id fc17mr1075777vec.14.1394710311198; Thu, 13 Mar 2014 04:31:51 -0700 (PDT) Received: from mail-ve0-f173.google.com (mail-ve0-f173.google.com [209.85.128.173]) by mx.google.com with ESMTPS id b4si669788vck.82.2014.03.13.04.31.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Mar 2014 04:31:51 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.173; Received: by mail-ve0-f173.google.com with SMTP id oy12so907852veb.18 for ; Thu, 13 Mar 2014 04:31:51 -0700 (PDT) X-Received: by 10.59.7.170 with SMTP id dd10mr1039050ved.12.1394710311108; Thu, 13 Mar 2014 04:31:51 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.78.9 with SMTP id i9csp360311vck; Thu, 13 Mar 2014 04:31:50 -0700 (PDT) X-Received: by 10.180.92.196 with SMTP id co4mr1200032wib.50.1394710310177; Thu, 13 Mar 2014 04:31:50 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id cr4si1229361wjc.137.2014.03.13.04.31.49 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 13 Mar 2014 04:31:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::1 as permitted sender) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1WO3rX-0003RA-Ip; Thu, 13 Mar 2014 11:31:47 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [PATCH] libqtest: Avoid inline varargs functions Date: Thu, 13 Mar 2014 11:31:47 +0000 Message-Id: <1394710307-13187-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Older versions of gcc (eg 4.6) can't handle varargs functions declared inline for anything other than completely trivial uses, and complain: tests/qom-test.c: In function 'qmp': tests/libqtest.h:359:60: sorry, unimplemented: function 'qmp' can never be inlined because it uses variable argument lists Avoid this problem by putting the functions into libqtest.c instead of using inline definitions in libqtest.h. Signed-off-by: Peter Maydell Reviewed-by: Andreas Färber --- This doesn't bite us with the current libqtest code but the enhancements Andreas has in his QOM queue do trigger this gcc 4.6 unimplemented behaviour. tests/libqtest.c | 20 ++++++++++++++++++++ tests/libqtest.h | 20 ++------------------ 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/tests/libqtest.c b/tests/libqtest.c index f587d36..b69dfca 100644 --- a/tests/libqtest.c +++ b/tests/libqtest.c @@ -581,3 +581,23 @@ void qtest_memwrite(QTestState *s, uint64_t addr, const void *data, size_t size) qtest_sendf(s, "\n"); qtest_rsp(s, 0); } + +QDict *qmp(const char *fmt, ...) +{ + va_list ap; + QDict *response; + + va_start(ap, fmt); + response = qtest_qmpv(global_qtest, fmt, ap); + va_end(ap); + return response; +} + +void qmp_discard_response(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + qtest_qmpv_discard_response(global_qtest, fmt, ap); + va_end(ap); +} diff --git a/tests/libqtest.h b/tests/libqtest.h index 9deebdc..8268c09 100644 --- a/tests/libqtest.h +++ b/tests/libqtest.h @@ -356,16 +356,7 @@ static inline void qtest_end(void) * * Sends a QMP message to QEMU and returns the response. */ -static inline QDict *qmp(const char *fmt, ...) -{ - va_list ap; - QDict *response; - - va_start(ap, fmt); - response = qtest_qmpv(global_qtest, fmt, ap); - va_end(ap); - return response; -} +QDict *qmp(const char *fmt, ...); /** * qmp_discard_response: @@ -373,14 +364,7 @@ static inline QDict *qmp(const char *fmt, ...) * * Sends a QMP message to QEMU and consumes the response. */ -static inline void qmp_discard_response(const char *fmt, ...) -{ - va_list ap; - - va_start(ap, fmt); - qtest_qmpv_discard_response(global_qtest, fmt, ap); - va_end(ap); -} +void qmp_discard_response(const char *fmt, ...); /** * get_irq: