Re: 2x compile warning

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: 2x compile warning
Дата
Msg-id 20060424215644.GH2747@svana.org
обсуждение исходный текст
Ответ на Re: 2x compile warning  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Mon, Apr 24, 2006 at 05:39:30PM -0400, Tom Lane wrote:
> > Yes, this coding removes the warning.
>
> Oh, good, that seems like a reasonable change to make (it's arguably
> more clear than the original anyway).
>
> Is this the only place where the warning shows up?  ISTM there's quite
> a lot of code that uses "if (ptr)" for a NULL-ness check.

But very little code of the form "if (&local_var)" which is always true
and what causes the problem here. I think this is just a variation on
the compiler test for "if (i=1)" which is also always true but probably
a bug. That warning you avoid with an extra set of parenthesis.

I'd be surprised if there were many other issues here, only complex
macros are likely to cause this one.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: 2x compile warning
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: 2x compile warning