Re: New string-truncation warnings from GCC 15

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: New string-truncation warnings from GCC 15
Дата
Msg-id 39d26ee5-661e-41dd-a9c2-4c6682db8f97@eisentraut.org
обсуждение исходный текст
Ответ на New string-truncation warnings from GCC 15  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: New string-truncation warnings from GCC 15
Список pgsql-hackers
On 17.09.25 00:48, Tom Lane wrote:
> Several of the buildfarm animals seem to have been updated to
> GCC 15 over the past week or so.  They are now moaning about
> various places where we're intentionally omitting a string
> terminator, eg these warnings from scorpion:
> 
>   scorpion      | 2025-09-16 18:39:03 | ../pgsql/src/backend/commands/copyfromparse.c:139:41: warning:
initializer-stringfor array of 'char' truncates NUL terminator but destination lacks 'nonstring' attribute (12 chars
into11 available) [-Wunterminated-string-initialization]
 

Note that this is not a default warning option in gcc or an option put 
in by PostgreSQL.  This comes from -Wextra, which that buildfarm member 
has added by itself.  So there is also an option C in having that 
buildfarm member turn off that option.

That said, I think addressing this with some attribute decoration could 
be useful.  But then we should also add this option explicitly to our 
warning option set, so that going forward we can maintain this locally 
and not via a lone buildfarm member.




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