[PATCH][check_GNU_style.sh] More aggressively ignore dg-xxx directives

Kyrill Tkachov kyrylo.tkachov@foss.arm.com
Tue Oct 11 15:22:00 GMT 2016

On 11/10/16 16:13, Jeff Law wrote:
> On 10/11/2016 05:01 AM, Bernd Schmidt wrote:
>> On 10/11/2016 12:56 PM, Jakub Jelinek wrote:
>>> On Tue, Oct 11, 2016 at 11:47:21AM +0100, Kyrill Tkachov wrote:
>>>> check_GNU_style.sh complains a lot about dg-* directives in the
>>>> testsuite and in particular about line lengths.
>>>> There's nothing we can do about the directives and sometimes they're
>>>> supposed to be long, in particular the scan-assembler
>>>> checks in dg-final.  Currently check_GNU_style.sh has code to avoid
>>>> warning for dg-* directives but it's too weak, it doesn't
>>>> catch dg-final or dg-options directives.
>>>> This patch makes the code ignore all "{ dg-.*" lines for length
>>>> purposes.
>>>> This eliminates a lot of false positives in my patches and didn't
>>>> filter any legitimate warnings in my patches.
>>> I wonder if we just shouldn't ignore all line lengths in testcases (or
>>> perhaps any coding style whatsoever).  Some testcases are meant to be
>>> formatted more-less according to our coding style (but, e.g.
>>> /* PR tree-optimization/12345 */
>>> comments never end with . and 2 spaces), except for dg- directives, but
>>> others are entered in whatever form they came from the reporter.
>> I agree, probably best not to check testcases for style (but then I
>> don't trust automatic checkers anyway).
> Agreed that checking testcases for style isn't desirable.

Ok, here's a patch that does that by filtering out everything between "+++.*testsuite/" and "+++<not testsuite>".
Is this is an ok approach?
This eliminates all testsuite warnings on a few of my patches that I tried it out on.

Disclaimer: I'm not an awk expert.


2016-10-11  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

     * check_GNU_style.sh (remove_testsuite): New function.
     Use it to remove testsuite from the diff.

> jeff

-------------- next part --------------
A non-text attachment was scrubbed...
Name: check_GNU.patch
Type: text/x-patch
Size: 1225 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20161011/da4b0075/attachment.bin>

More information about the Gcc-patches mailing list