This is the mail archive of the gdb-patches@sources.redhat.com 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: [commit] Fix "show prompt"


> 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.


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