From: Jani Nikula Date: Wed, 23 Sep 2015 18:48:05 +0000 (+0300) Subject: [PATCH v2] test: check argc in symbol-test X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=031ad3ba92a2ece936b75c0bd93ebcc30c66dfbb;p=notmuch-archives.git [PATCH v2] test: check argc in symbol-test --- diff --git a/d7/4b2365bf50860823e77ff88345fa6179bb2467 b/d7/4b2365bf50860823e77ff88345fa6179bb2467 new file mode 100644 index 000000000..8071cc56d --- /dev/null +++ b/d7/4b2365bf50860823e77ff88345fa6179bb2467 @@ -0,0 +1,98 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by arlo.cworth.org (Postfix) with ESMTP id 6D6096DE14C7 + for ; Wed, 23 Sep 2015 11:48:28 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: -0.511 +X-Spam-Level: +X-Spam-Status: No, score=-0.511 tagged_above=-999 required=5 tests=[AWL=0.209, + RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01] + autolearn=disabled +Received: from arlo.cworth.org ([127.0.0.1]) + by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id 7gKYuTtNPpNL for ; + Wed, 23 Sep 2015 11:48:26 -0700 (PDT) +Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com + [209.85.212.178]) + by arlo.cworth.org (Postfix) with ESMTPS id 3CCEC6DE143A + for ; Wed, 23 Sep 2015 11:48:26 -0700 (PDT) +Received: by wiclk2 with SMTP id lk2so82769772wic.1 + for ; Wed, 23 Sep 2015 11:48:24 -0700 (PDT) +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20130820; + h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to + :references:mime-version:content-type:content-transfer-encoding; + bh=2X2skWhnRDLP2UKHwUhY8gxINdJM1zPRY7zMTKa4cmQ=; + b=HKyFl1vh5yXBp7ziTaT0vxo5ICp/anYAdDFbxLOzJIZ2ivoKiiIVUxLRwK88KMnizR + 1ih1OcKZ0+naF5zspdX+kxJZ+qpv2kiS1MGzbSh3iYuLmVXHV9GZolWOX6AyuUdrsNgB + iLHvoS/vxlXVoD/zQuG5ZHFZlRhXCm87ZfQKk7s9TxE3HeTHUpDJ77dVY2Hlj1dSLcgG + 9UIp3bdtpg/qFf+czF8lnvqIuV/d5Vln+J0ok8VZ2i4KByExm7YMLIXFu9SDeKKef9r/ + 8ybhmk4YEoiJbH4mQRvV0Rumsc0JW7rKBrpqgDGqHYxH4uAwd7fLpdQEgbyhwcfVCJwI + dulg== +X-Gm-Message-State: + ALoCoQlnDMaBvNi6aF3rhOGXsGiu6vLeLEoW+Fi+ZF1HoHFYavChK0sSsi9GiZF9rQZftb3nAoXW +X-Received: by 10.194.24.68 with SMTP id s4mr12039185wjf.12.1443034104403; + Wed, 23 Sep 2015 11:48:24 -0700 (PDT) +Received: from localhost (mobile-access-bcee4f-131.dhcp.inet.fi. + [188.238.79.131]) + by smtp.gmail.com with ESMTPSA id i9sm8571634wjz.20.2015.09.23.11.48.22 + (version=TLSv1/SSLv3 cipher=OTHER); + Wed, 23 Sep 2015 11:48:23 -0700 (PDT) +From: Jani Nikula +To: David Bremner , Jani Nikula , + notmuch@notmuchmail.org +Subject: [PATCH v2] test: check argc in symbol-test +Date: Wed, 23 Sep 2015 21:48:05 +0300 +Message-Id: <1443034085-4358-1-git-send-email-jani@nikula.org> +X-Mailer: git-send-email 2.1.4 +In-Reply-To: <87k2s2z9cb.fsf@zancas.localnet> +References: <87k2s2z9cb.fsf@zancas.localnet> +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.18 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Wed, 23 Sep 2015 18:48:28 -0000 + +Check argc mainly to fix unused parameter warning: + +test/symbol-test.cc:7:14: warning: unused parameter ‘argc’ [-Wunused-parameter] + int main(int argc, char** argv) { + ^ + +This makes more sense than telling the compiler it's unused on +purpose. +--- + test/symbol-test.cc | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/test/symbol-test.cc b/test/symbol-test.cc +index 77dbc1af44b2..7454838bfd31 100644 +--- a/test/symbol-test.cc ++++ b/test/symbol-test.cc +@@ -8,6 +8,9 @@ int main (int argc, char** argv) + notmuch_database_t *notmuch; + char *message = NULL; + ++ if (argc != 3) ++ return 1; ++ + if (notmuch_database_open_verbose (argv[1], NOTMUCH_DATABASE_MODE_READ_ONLY, + ¬much, &message)) { + if (message) { +-- +2.1.4 +