[RFC] Dejagnu patch to handle multi-line directives

Richard Sandiford richard.sandiford@linaro.org
Tue Jun 13 06:59:00 GMT 2017


Pedro Alves <palves@redhat.com> writes:
> On 06/12/2017 08:59 AM, Richard Sandiford wrote:
>> I realise there's probably more that can go wrong with it, but how
>> about instead treating unbalanced { ... } as a sign that the directive
>> continues to the next line?  This would allow:
>> 
>> /* { dg-additional-options
>>       "-DSTACK_SIZE=[dg-effective-target-value stack_size]"
>>       { target { stack_size } } } */
>
> In a TCL .exp file you'd split the lines with a '\' continuation
> character.  Wouldn't that be more natural?  Like:
>
>  /* { dg-additional-options                                   \
>        "-DSTACK_SIZE=[dg-effective-target-value stack_size]"  \
>        { target { stack_size } } } */

It'd be more normal to omit \ in a braced list though, so I think
the version without is more natural Tcl style.

> Might be less magical and simpler to implement too.

The reason I avoided \ was because it's a "native" continuation marker
for C and C++, but not for Fortran, Ada and others.  So using \ would
change the way the comment is treated by some front ends and not others.

E.g. things like:

//  a \
//  b

trigger:

  warning: multi-line comment [-Wcomment]

(Maybe moot anyway given Mike's response.)

Thanks,
Richard



More information about the Gcc-patches mailing list