Re: more compile warnings

Поиск
Список
Период
Сортировка
От Dann Corbit
Тема Re: more compile warnings
Дата
Msg-id D90A5A6C612A39408103E6ECDD77B8294089F9@voyager.corporate.connx.com
обсуждение исходный текст
Ответы Re: more compile warnings  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-hackers
> -----Original Message-----
> From: Bruce Momjian [mailto:pgman@candle.pha.pa.us]
> Sent: Friday, December 06, 2002 7:58 PM
> To: Joe Conway
> Cc: rbt@zort.ca; 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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: IPv6 patch rejected
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: more compile warnings