From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 542A938582B7; Sun, 4 Dec 2022 01:02:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 542A938582B7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1670115763; bh=tg5agtGdwQwKYVv91a7O8aVsi0ZQs1gqWMu+SDd0B+s=; h=From:To:Subject:Date:From; b=WiIfj7G7MVJkjhMAnn9cQ+bXj5vUAYMT2mRu9vrxdc7byQriT0HnF9PhPfz4Z02tT ZNUdEuu4Vqyb2Glrz4wAZ3HjPixPEATtklAR6rdJOQ061T843KYZzijFFMeQuMl7FG /Ne17LuG1jAiMBBedJtIEGP9v+1YP+TiyNylGSUI= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug bootstrap/107960] New: opt-gather.awk seems to ignore lines lines that start with whitespace Date: Sun, 04 Dec 2022 01:02:41 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: bootstrap X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: documentation X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107960 Bug ID: 107960 Summary: opt-gather.awk seems to ignore lines lines that start with whitespace Product: gcc Version: 13.0 Status: UNCONFIRMED Keywords: documentation Severity: normal Priority: P3 Component: bootstrap Assignee: unassigned at gcc dot gnu.org Reporter: pinskia at gcc dot gnu.org Target Milestone: --- echo -e "aaa\n a\n a\na" | awk -f opt-gather.awk > t.txt and then look at the result of t.txt and notice that only aaa^\a is in the file. No error message happens either. The code in the old opts.sh (which is still the awk script) was broken too. The problem is here: /^[ \t]*(;|$)/ { flag =3D 0; next } /^[^ \t]/ { if (flag =3D=3D 0) { Notice how that the pattern is matching all lines that don't start with whi= te space. Also notice how a comment is considered a record seperator too.=20 Neither of this is documented either. The documentation for comments is: Comments may appear on their own line anywhere within the file and are prec= eded by semicolons.=20 Which to mean it in the middle of a record but the code does not allow that. Have the ability of the "white space" in the front being a comment inside t= he record is a nice feature but I do think it should be documented though.=