From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-4.1 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 140B91F461 for ; Sun, 8 Sep 2019 15:19:39 +0000 (UTC) Received: from localhost ([::1]:49184 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i6yyX-00084x-PR for normalperson@yhbt.net; Sun, 08 Sep 2019 11:19:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45104) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i6yyU-00084q-HC for bug-gnulib@gnu.org; Sun, 08 Sep 2019 11:19:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i6yyT-0002qw-Hh for bug-gnulib@gnu.org; Sun, 08 Sep 2019 11:19:34 -0400 Received: from mail-wr1-f51.google.com ([209.85.221.51]:34496) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i6yyT-0002op-CE for bug-gnulib@gnu.org; Sun, 08 Sep 2019 11:19:33 -0400 Received: by mail-wr1-f51.google.com with SMTP id a11so1377480wrx.1 for ; Sun, 08 Sep 2019 08:19:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=FvFf6uY1yF1ea+NBLJXJS5AYcOU+Hq3z3B9U/+pURwo=; b=OgP8TzdVBsXvxcRPxVv4D+xr6TIf51CoNwzfzSflxMtKp2pkGYleBI+IsE0fX7mD5+ WmBsN1qcDNSQiLE+CYLw27RI5j0b8RDcm4jod9LWrZzI8ChdWHhZ/K2EkuwotGxpAB5C +AQuLLM60l9Fhwg6F/3Lf0eckHDJqrQD+eeb4F+rBbHKRKB6c3lPMpPLqi1dx+XagvSE xK2iSpT5cU4DR4B9Fow0C9TCEDZu7ek79of1+wuAyw/B6GHcTp1wK2GurdBS4FWkq+e8 33pmlgQ+Pwv7b4TvQRXWypkUpkeXfEWbfB8E+IaOuR+qPMFJyHA8sF4+C8Kws3jX4Ue1 tXVg== X-Gm-Message-State: APjAAAVt7yHi7daUaaCPktLUIetSX7PBELDRP78YaVGvq1kh4df+h/O3 EkEtISiZ1yENEb+0nasfxzpkj/zxmdl4Rpk7/Kg8L3HM X-Google-Smtp-Source: APXvYqxODQryNJAT4wz70EHBZtH/dselK/bJrreD59nTfkWojiP54VZ3ClnzIMQMZUwDm5jjBlC4cM+N7MuDsnl+9N8= X-Received: by 2002:a05:6000:1187:: with SMTP id g7mr15168184wrx.192.1567955969686; Sun, 08 Sep 2019 08:19:29 -0700 (PDT) MIME-Version: 1.0 References: <20190908125619.qabhrayjeeium3du@tardis.localdomain> In-Reply-To: <20190908125619.qabhrayjeeium3du@tardis.localdomain> From: Jim Meyering Date: Sun, 8 Sep 2019 08:19:16 -0700 Message-ID: Subject: Re: sc_prohibit_magic_number_exit false positive on string To: "bug-gnulib@gnu.org List" Content-Type: text/plain; charset="UTF-8" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.221.51 X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" On Sun, Sep 8, 2019 at 6:06 AM Darshit Shah wrote: > I just realized that the syntax check rule sc_prohibit_magic_number_exit will > cause a false positive when it finds the relevant tokens within a string as > well. > > For example, in Wget, we have the following snippet in our tests which trips > this rule: > > > WGET_TEST_EXPECTED_FILES, &(wget_test_file_t []) { > > { "exit-status.txt", "exit(8)\n" }, > > { NULL } }, > > I made a very tiny change to the rule in maint.mk(L408) to account for this: > > -exclude='exit \(77\)|error ?\(((0|77),|[^,]*)' \ > +exclude='exit \(77\)|error ?\(((0|77),|[^,]*)|"(usage|exit|error).*"' \ Hi Darshit, that feels a little too specific. Did you consider exempting that file from this one check? You can do that by adding a line like the following to cfg.mk: exclude_file_name_regexp--sc_prohibit_magic_number_exit = offending-file-regexp\.c$$