Small patch: fix warnings during compilation on FreeBSD

Поиск
Список
Период
Сортировка
От Aleksander Alekseev
Тема Small patch: fix warnings during compilation on FreeBSD
Дата
Msg-id 20160310163632.53d8e2cc@fujitsu
обсуждение исходный текст
Ответы Re: Small patch: fix warnings during compilation on FreeBSD  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hello

I noticed that master branch of PostgreSQL currently compiles with
warnings on FreeBSD 10.2 RELEASE:

```
pg_locale.c:1290:12: warning: implicit declaration of function
'wcstombs_l' is invalid in C99 [-Wimplicit-function-declaration]

result = wcstombs_l(to, from, tolen, locale);

pg_locale.c:1365:13: warning: implicit declaration of function
'mbstowcs_l' is invalid in C99 [-Wimplicit-function-declaration]

result = mbstowcs_l(to, str, tolen, locale);

2 warnings generated.
```

The problem is that both procedures are declared in xlocale.h file
which is not included in given context. If I remember correctly in
this case compiler assumes that procedures return `int` (instead of
size_t) so I doubt we can ignore this issue.

Frankly I'm not sure what is a right way of fixing this. My best guess
is attached to this message. I tested this patch on Ubuntu Linux 14.04
and FreeBSD 10.2. It solves a described problem and apparently doesn't
break anything (code compiles, regression tests pass, etc).

Best regards,
Aleksander
Вложения

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

Предыдущее
От: David Steele
Дата:
Сообщение: Re: Identifying a message in emit_log_hook.
Следующее
От: Tomas Vondra
Дата:
Сообщение: Re: Using quicksort for every external sort run