This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch] Fix PR 5582 and 10538, missed uninitialized variablewarning
- From: Jason Merrill <jason at redhat dot com>
- To: Andrew Pinski <pinskia at physics dot uc dot edu>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 19 Aug 2003 15:29:36 -0400
- Subject: Re: [Patch] Fix PR 5582 and 10538, missed uninitialized variablewarning
- References: <298C2332-D274-11D7-8DE3-000393A6D2F2@physics.uc.edu>
On Tue, 19 Aug 2003 14:37:18 -0400, Andrew Pinski <pinskia@physics.uc.edu> wrote:
> Patch:
Your patch seems to suffer from line wrapping; does your mail client
support attachments?
> +/* Nonzero means warn about uninitialized variable when it is initialized
> with it self.
^ no space
> +/* Used by c_decl_uninit to find where expressions like x = x + 1; */
> +static tree
> +c_decl_uninit_1 (tree *t, int *walk_sub_trees, void *x)
> +{
> + /* If x = EXP(&x)EXP, then do not warn about the use of x.
> + FIXME: Should not warn about this: int *x = &(x+2);. */
You were going to remove this FIXME. Also, there should be a blank line
between the comment and the function.
> +/* Find out if a variable is uninitialized based on DECL_INITIAL. */
> +bool
> +c_decl_uninit (tree t)
Here, too.
> + /* int x = x; is GCC extension to turn off this warning, only if not
> pedantic. */
This comment also needs to be updated.
> + /* Walk the trees look for the variable it self. */
^ing ^ no space
With these adjustments, the patch is OK.
Jason