This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [commit] Fix "show prompt"
- From: Eli Zaretskii <eliz at gnu dot org>
- To: gdb-patches at sourceware dot org
- Date: Sun, 29 May 2005 09:13:06 +0300
- Subject: Re: [commit] Fix "show prompt"
- References: <20050528182825.GD26806@nevyn.them.org>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> Date: Sat, 28 May 2005 14:28:26 -0400
> From: Daniel Jacobowitz <drow@false.org>
>
> One of the gcc4 warnings patches incorrectly converted the var_string
> case; it's a char **, not a char *.
True.
> switch (c->var_type)
> {
> case var_string:
> - if (((char *)c->var)[0] != '\0')
> - fputstr_filtered ((char *)c->var, '"', stb->stream);
> + if (*(char **) c->var)
Doesn't this work without a cast, like this:
if (*c->var != NULL)
? I think we should avoid unneeded type-casting.