PATCH: PR c/36892: Support __attribute__((deprecated("text string")))

H.J. Lu hjl.tools@gmail.com
Fri May 8 13:32:00 GMT 2009


On Fri, May 8, 2009 at 3:25 AM, Joseph S. Myers <joseph@codesourcery.com> wrote:
> On Thu, 7 May 2009, H.J. Lu wrote:
>
>> Here is the updated patch.  dg.exp doesn't support the same
>> regexp with dg-warning at different lines. I can only put
>> regexp at the last dg-warning. Are C and C++ parts OK?
>
> I don't understand what you are claiming doesn't work with dg-warning; I
> know of no such issue with dg.exp.
>

There are several warnings. We will try to match them with

/* { dg-warning "'f1' is deprecated .declared at .*.: Please avoid f1" "" } */

dg-test in dg.exp will match each of them with:

    foreach i ${dg-messages} {
        verbose "Scanning for message: $i" 4

        # Remove all error messages for the line [lindex $i 0]
        # in the source file.  If we find any, success!
        set line [lindex $i 0]
        set pattern [lindex $i 2]
        set comment [lindex $i 3]
        #send_user "Before:\n$comp_output\n"
        if [regsub -all
"(^|\n)(\[^\n\]+$line\[^\n\]*($pattern)\[^\n\]*\n?)+" $comp_output
"\n" comp_output] {
            set comp_output [string trimleft $comp_output]
            set ok pass
            set uhoh fail
        } else {
            set ok fail
            set uhoh pass
        }

where $dg-messages is a list of

"'f1' is deprecated .declared at .*.: Please avoid f1"

with different line numbers. The fist one will match all warnings
in $comp_output and more, which lead to many failures.


-- 
H.J.



More information about the Gcc-patches mailing list