Inconsistent printf placeholders

Поиск
Список
Период
Сортировка
От Kyotaro Horiguchi
Тема Inconsistent printf placeholders
Дата
Msg-id 20240314.132041.2150305296896280760.horikyota.ntt@gmail.com
обсуждение исходный текст
Ответы Re: Inconsistent printf placeholders  (Daniel Gustafsson <daniel@yesql.se>)
Re: Inconsistent printf placeholders  (Peter Eisentraut <peter@eisentraut.org>)
Список pgsql-hackers
Hello.

A recent commit 6612185883 introduced two error messages that are
identical in text but differ in their placeholders.

-            pg_fatal("could not read file \"%s\": read only %d of %d bytes",
-                     filename, (int) rb, (int) st.st_size);
+            pg_fatal("could not read file \"%s\": read only %zd of %lld bytes",
+                     filename, rb, (long long int) st.st_size);
...
-            pg_fatal("could not read file \"%s\": read only %d of %d bytes",
+            pg_fatal("could not read file \"%s\": read only %d of %u bytes",
                      rf->filename, rb, length);

I'd be happy if the two messages kept consistency. I suggest aligning
types instead of making the messages different, as attached.

regards.

-- 
Kyotaro Horiguchi
NTT Open Source Software Center

Вложения

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

Предыдущее
От: Thomas Munro
Дата:
Сообщение: Re: Recent 027_streaming_regress.pl hangs
Следующее
От: Kyotaro Horiguchi
Дата:
Сообщение: Typos in reorderbuffer.c.