compiler warning in UtfToLocal and LocalToUtf (conv.c)

Поиск
Список
Период
Сортировка
От Karol Trzcionka
Тема compiler warning in UtfToLocal and LocalToUtf (conv.c)
Дата
Msg-id 51E8829A.5020507@gmail.com
обсуждение исходный текст
Ответы Re: compiler warning in UtfToLocal and LocalToUtf (conv.c)  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hello,
in the current master head (4cbe3ac3e86790d05c569de4585e5075a62a9b41),
I've noticed the compiler warnings in src/backend/utils/mb/conv.c
conv.c: In function ‘UtfToLocal’:
conv.c:252:23: error: ‘iutf’ may be used uninitialized in this function
[-Werror=maybe-uninitialized]
...
conv.c: In function ‘LocalToUtf’:
conv.c:301:23: error: ‘iiso’ may be used uninitialized in this function
[-Werror=maybe-uninitialized]
...
The compiler doesn't know that the 'l' may varies between 1 and 4. Hot
fix may be:
1. preinitialize it
2. delete last if statement (change else-if to else)
3. change it to switch-case and set default behaviour
Regards,
Karol



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

Предыдущее
От: "Inoue, Hiroshi"
Дата:
Сообщение: Re: [ODBC] getting rid of SnapshotNow
Следующее
От: Greg Smith
Дата:
Сообщение: Re: ALTER SYSTEM SET command to change postgresql.conf parameters (RE: Proposal for Allow postgresql.conf values to be changed via SQL [review])