public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug bootstrap/107960] New: opt-gather.awk seems to ignore lines lines that start with whitespace
@ 2022-12-04  1:02 pinskia at gcc dot gnu.org
  2022-12-05 14:26 ` [Bug bootstrap/107960] " marxin at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-12-04  1:02 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107960

            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 = 0; next }
/^[^ \t]/       { if (flag == 0) {

Notice how that the pattern is matching all lines that don't start with white
space.

Also notice how a comment is considered a record seperator too. 

Neither of this is documented either.

The documentation for comments is:
Comments may appear on their own line anywhere within the file and are preceded
by semicolons. 

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 the
record is a nice feature but I do think it should be documented though.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug bootstrap/107960] opt-gather.awk seems to ignore lines lines that start with whitespace
  2022-12-04  1:02 [Bug bootstrap/107960] New: opt-gather.awk seems to ignore lines lines that start with whitespace pinskia at gcc dot gnu.org
@ 2022-12-05 14:26 ` marxin at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-12-05 14:26 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107960

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2022-12-05
                 CC|                            |marxin at gcc dot gnu.org
             Status|UNCONFIRMED                 |NEW

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-12-05 14:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-04  1:02 [Bug bootstrap/107960] New: opt-gather.awk seems to ignore lines lines that start with whitespace pinskia at gcc dot gnu.org
2022-12-05 14:26 ` [Bug bootstrap/107960] " marxin at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).