PATCH: Selector warning

Devang Patel dpatel@apple.com
Thu Aug 1 16:07:00 GMT 2002


On Thursday, August 1, 2002, at 04:01  PM, Nicola Pero wrote:

>
>> +                 break;
>> +               }
>> +           }
>> +         if (!found)
>> +           {
>> +             /* Adjust line number for warning message.  */
>> +             int save_lineno = lineno;
>> +             if (flag_next_runtime && TREE_PURPOSE(chain))
>
> I didn't try it out - just read the code - but an obvious questions 
> pops
> up here - why this instruction is only for the next runtime ?

Because, gnu runtime uses TREE_PURPOSE (chain) for different use. I did 
not exactly
found a way to get correct line number for gnu runtime. May be you can 
provide me
some  help.

>> +               lineno = DECL_SOURCE_LINE(TREE_PURPOSE(chain));
>> +             warning ("creating selector for non existant method %s",
>> +                    IDENTIFIER_POINTER (TREE_VALUE(chain)));
>> +             lineno = save_lineno;
>> +           }
>> +       }
>> +
>>          expr = build_selector (TREE_VALUE (chain));
>>
>>          if (flag_next_runtime)
>>
>> Index: selector-1.m
>> ===================================================================
>> RCS file: selector-1.m
>> diff -N selector-1.m
>> *** /dev/null   1 Jan 1970 00:00:00 -0000
>> --- selector-1.m        1 Aug 2002 21:09:56 -0000
>> ***************
>> *** 0 ****
>> --- 1,26 ----
>> + /* Test warning for non existing selectors.  */
>> + /* Contributed by Devang Patel <dpatel@apple.com>.  */
>> + /* { dg-options "-Wselector -fnext-runtime" } */
>
> I don't understand why you add -fnext-runtime here.  Any reason why 
> this
> patch/test should be next-runtime only ?

Without -fnext-runtime the line number in the warning will be
max._no_of_lines_in_source_file + 1.

-Devang



More information about the Gcc-patches mailing list