From: Jani Nikula Date: Fri, 4 Sep 2015 18:49:15 +0000 (+0300) Subject: [PATCH 2/2] test: check argc in symbol-test X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=51e6a9c80950ab3e91f0dc8448fe28a7fdae5adc;p=notmuch-archives.git [PATCH 2/2] test: check argc in symbol-test --- diff --git a/8c/cce5ad5c7aea91b290715ae4ec45821b7d8cc5 b/8c/cce5ad5c7aea91b290715ae4ec45821b7d8cc5 new file mode 100644 index 000000000..37e385acf --- /dev/null +++ b/8c/cce5ad5c7aea91b290715ae4ec45821b7d8cc5 @@ -0,0 +1,97 @@ +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 F0EC46DE1510 + for ; Fri, 4 Sep 2015 11:49:24 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: -0.492 +X-Spam-Level: +X-Spam-Status: No, score=-0.492 tagged_above=-999 required=5 tests=[AWL=0.228, + 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 zTGMXxuXqdcO for ; + Fri, 4 Sep 2015 11:49:23 -0700 (PDT) +Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com + [209.85.212.177]) + by arlo.cworth.org (Postfix) with ESMTPS id F1B496DE147C + for ; Fri, 4 Sep 2015 11:49:22 -0700 (PDT) +Received: by wicfx3 with SMTP id fx3so26711492wic.0 + for ; Fri, 04 Sep 2015 11:49:21 -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:cc:subject:date:message-id:in-reply-to + :references:mime-version:content-type:content-transfer-encoding; + bh=4ew+8IJlwj2a0z+C6jH5ULLKhS0BzO+Jl4HtHm9bMWU=; + b=gi5uOm8wCjYOvbZVFclPvjHLqLvYqDJ4QM1DvcmRjHZlJiFNw2mRqWGbqOdMlzs9ZA + Pji1MZbpZobsnmFbPJc8kFg944TUixUJ181/JE1481+WR6C6FUkqjiMVr2pLbSAf4g/3 + lhpC/xH1b5GdlGihQrASLmShf9VxvEpYMKHMlmp0uM9gnYhPjUnP7S8AjMahH/EQ7enw + 0BGNjoE3fzoA1TUEFIAlSmwI356Pb6QTCw7s9lP+qDlBOKaDyv5i8hcVSHidoMG0lW6Z + dFbUJ5VqCagxdTR2eWu2YHZfTxoraaPpyUTS0i3URwnZgkgiybq9k2U1VqpC3YVL8zSA + gXoA== +X-Gm-Message-State: + ALoCoQmtBe45rYnkpd6hfcxlcyO9ZC0PQOEDQ3OS8U8E2rY4BJgQV/o1B7XgxCT3mfMa3RGgNyCH +X-Received: by 10.180.89.41 with SMTP id bl9mr9761878wib.85.1441392561341; + Fri, 04 Sep 2015 11:49:21 -0700 (PDT) +Received: from localhost (mobile-access-bcee4f-131.dhcp.inet.fi. + [188.238.79.131]) + by smtp.gmail.com with ESMTPSA id lz10sm5553267wjb.48.2015.09.04.11.49.20 + (version=TLSv1/SSLv3 cipher=OTHER); + Fri, 04 Sep 2015 11:49:20 -0700 (PDT) +From: Jani Nikula +To: notmuch@notmuchmail.org +Subject: [PATCH 2/2] test: check argc in symbol-test +Date: Fri, 4 Sep 2015 21:49:15 +0300 +Message-Id: <1441392555-20056-2-git-send-email-jani@nikula.org> +X-Mailer: git-send-email 2.1.4 +In-Reply-To: <1441392555-20056-1-git-send-email-jani@nikula.org> +References: <1441392555-20056-1-git-send-email-jani@nikula.org> +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: Fri, 04 Sep 2015 18:49:25 -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..23583bfc11b5 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 != 2) ++ return 1; ++ + if (notmuch_database_open_verbose (argv[1], NOTMUCH_DATABASE_MODE_READ_ONLY, + ¬much, &message)) { + if (message) { +-- +2.1.4 +