> -----Original Message-----
> From: Bruce Momjian [mailto:[EMAIL PROTECTED]] 
> Sent: Friday, December 06, 2002 7:58 PM
> To: Joe Conway
> Cc: [EMAIL PROTECTED]; PostgreSQL-development
> Subject: Re: [HACKERS] more compile warnings
> 
> 
> Rod, can you comment on these warnings Joe Conway's compiler 
> is showing? I don't see the warnings with gcc, but clearly 
> they look like problems.
> 
> I can just assign a NULL on definition, but I thought you 
> should take a look.
> 
> --------------------------------------------------------------
> -------------
> 
> Joe Conway wrote:
> > Hi Bruce,
> > 
> > I just sync'd up/make clean/make all and get this:
> > 
> > gcc -O2 -g -Wall -Wmissing-prototypes -Wmissing-declarations 
> > -I../../../src/include   -c -o typecmds.o typecmds.c -MMD
> > typecmds.c: In function `AlterDomainAddConstraint':
> > typecmds.c:1237: warning: `ccbin' might be used 
> uninitialized in this 
> > function
> > typecmds.c: In function `get_rels_with_domain':
> > typecmds.c:1450: warning: `rtc' might be used uninitialized 
> in this function

Instead of just assigning a value, it means it is conceivable that a
path allows undefined behavior.  Example:

...
 int y;
 if (x < 5) 
   y = 3;
 if (x > 5)
   y = 1;

What happens if x == 5?  Then y is indeterminate.

Sometimes, the flow analysis just gets confused and it really will be
initialized along every path.  But at least it bears checking.  Hence
the warning.

I like to use -W -Wall -ansi -pedantic -O3

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Reply via email to