From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 355403861C64; Sat, 26 Jun 2021 04:09:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 355403861C64 From: "wilson at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/98892] FAIL: gcc.dg/plugin/diagnostic-test-expressions-1.c Date: Sat, 26 Jun 2021 04:09:10 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: wilson at gcc dot gnu.org X-Bugzilla-Status: NEW 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: cc Message-ID: In-Reply-To: References: 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2021 04:09:13 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98892 Jim Wilson changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wilson at gcc dot gnu.org --- Comment #2 from Jim Wilson --- I ran into this with a riscv toolchain make check. Debugging, I discovered that if my terminal window is 80 characters wide, t= hen context->max_caret_width gets set to 78 in diagnostic.c, and then in diagnostic-show-locus.c m_x_offset_display gets set to 9, and then in print_trailing_fixits it calls move_to_column with column set to 9 which ca= uses an extra unnecessary newline to be emitted. This extra newline leads to th= e "1 blank lines in output" error. Also, I suspect that there is a contributing= bug in the dg-{begin,end}-multiline-output support that causes it to fail when = an error is followed by two newlines. This causes the "expected multiline pat= tern lines 550-551" failure. A bit of experimenting with the testcase in isolation shows that if my scre= en is 88 chars wide there is no extra newline, and if my screen is 87 chars wi= de I get the extra newline. A bit of experimenting with RUNTESTFLAGS=3D"plugin.exp" show that the testc= ase fails every time when my screen is 80 characters wide and works everytime w= hen my screen is 81 characters wide. I don't know why this number is different than above. A testcase whose success depends on screen width is very annoying. One way to work around the problem is to make the line shorter. If I delete one tab char from line 548 of gcc.dg/plugin/diagnostic-test-expressions-1.c= and 8 space characters from the two matching error lines 550 and 551, then the testcase does work with an 80 character wide terminal. However, it does now fail with a 77 char wide screen due to a different line 415-416. So this i= sn't an ideal solution. But it works for me as my screens are always 80 charact= ers wide. ideally there should be a way to turn off the max_caret_width stuff when running the testsuite so results don't depend on screen width. Someone who knows the diagnostic code should probably look at this. Or maybe print_trailing_fixits can be fixed? It isn't obvious why it needs= to call move_to_column at the end.=