ecpg compiler warning about char* comparison

Поиск
Список
Период
Сортировка
От Takahiro Itagaki
Тема ecpg compiler warning about char* comparison
Дата
Msg-id 20100308104602.9C53.52131E4D@oss.ntt.co.jp
обсуждение исходный текст
Ответы Re: ecpg compiler warning about char* comparison  (Michael Meskes <meskes@postgresql.org>)
Список pgsql-hackers
There is a complier warning in ecpg/ecpglib/error.c on HEAD:

error.c: In function 'eecpg_raise_backend':
error.c:309: warning: comparison with string literal results in unspecified behavior

It comes from the following coparison:
---
#define ECPG_SQLSTATE_ECPG_INTERNAL_ERROR    "YE000"
char       *sqlstate;
if (sqlstate == ECPG_SQLSTATE_ECPG_INTERNAL_ERROR)
---

Instead, should we use "if (strcmp(...) == 0)" here?

Regards,
---
Takahiro Itagaki
NTT Open Source Software Center



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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Re: incorrect exit code from psql with single transaction + violation of deferred FK constraint
Следующее
От: fanng yuan
Дата:
Сообщение: arithmetic about inet