On Thu, Nov 30, 2023 at 12:39:22PM -0500, Marek Polacek wrote:
> On Thu, Nov 30, 2023 at 06:37:21PM +0100, Florian Weimer wrote:
> > * Marek Polacek:
> >
> > >> +void
> > >> +implicit_function_declaration (void)
> > >> +{
> > >> + f1 (); /* { dg-warning "'f1' \\\[-Wimplicit-function-declaration\\\]"
> > >> } */
> > >> +}
> > >> +
> > >> +extern implicit_int_1; /* { dg-warning "'implicit_int_1'
> > >> \\\[-Wimplicit-int\\\]" } */
> > >
> > > Oy, these \ tend to get unwieldy. You could probably just say
> > > { dg-warning {-Wimplicit-int} }
> >
> > I wanted to have some more context for the other files that might get
> > the explict line number wrong.
> >
> > >> + return incompatible_pointer_types; /* { dg-error "returning 'int
> > >> \\\* \\\(\\\*\\\)\\\(int\\\)' from a function with incompatible return
> > >> type 'int \\\*' \\\[-Wincompatible-pointer-types\\\]" } */
> > >
> > > And here maybe
> > > { dg-error {returning 'int \* \(\*\)\(int\)' from a function with
> > > incompatible return type 'int \*' \[-Wincompatible-pointer-types\]} }
> > > could work the same. But you don't have to go and change it; I don't
> > > want to make more work for you.
> >
> > Oh, I'm not too familiar with Tcl. I haven't seen single quotes being
> > used elsewhere. I prefer not to change it unless there is another
> > reason to rework all this. So … let's wait?
>
> Sure.
Note, I think \\\s are used in thousands of dg-error/dg-warning etc.
in other tests already, I think it isn't a big deal.
find testsuite -type f | xargs grep 'dg-\(warning\|error\|message\).*".*\\\\\\'
| wc -l
4782
Sure, with using {} instead of "" one can get rid of some of the \s.
Jakub