This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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] Fix PR 5582 and 10538, missed uninitialized variablewarning


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


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