This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Add support for imported declaration and correct search order


>>>>> "Sami" == Sami Wagiaalla <swagiaal@redhat.com> writes:

Sami>    2010-03-03  Sami Wagiaalla  <swagiaal@redhat.com>
Sami>         PR c++/7936:

Getting close...

Sami> +cp_add_using_directive (const char *dest,
Sami> +			const char *src,
Sami> +			const char *alias,
Sami> +			const char *declaration,
Sami>                         struct obstack *obstack)
[...]
Sami> +  if (declaration != NULL)
Sami> +    new->declaration = savestring (declaration, strlen (declaration));

obsavestring

Does the duplicate exclusion logic here need to be updated to account
for the new field?

Sami> @@ -3448,23 +3448,32 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu)
Sami> +      canonical_name = (char *) imported_name_prefix;

I don't think you should need to cast away const in this function.
There is some other way to make it work, like having a non-const
temporary hold the result of alloca.

Sami> +      else
Sami> +        {
Sami> +          canonical_name = alloca (strlen (imported_name) + 1);
Sami> +          strcpy (canonical_name, imported_name);
Sami> +        }

I think this is a pointless copy, just do canonical_name = imported_name.

thanks,
Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]