On 18.06.24 04:35, Andres Freund wrote:
On 2024-06-17 23:52:54 +0200, Daniel Gustafsson wrote:
Since sqlca is, according to our docs, present in other database systems we
should probably keep it a 5-char array for portability reasons. Adding a
padding character should be fine though.
How abou
Hi,
On 2024-06-17 22:42:41 -0400, Tom Lane wrote:
> Andres Freund writes:
> > On 2024-06-17 23:52:54 +0200, Daniel Gustafsson wrote:
> >> Since sqlca is, according to our docs, present in other database systems we
> >> should probably keep it a 5-char array for portability reasons. Adding a
> >>
Andres Freund writes:
> On 2024-06-17 23:52:54 +0200, Daniel Gustafsson wrote:
>> Since sqlca is, according to our docs, present in other database systems we
>> should probably keep it a 5-char array for portability reasons. Adding a
>> padding character should be fine though.
> How about, addit
Hi,
On 2024-06-17 23:52:54 +0200, Daniel Gustafsson wrote:
> Since sqlca is, according to our docs, present in other database systems we
> should probably keep it a 5-char array for portability reasons. Adding a
> padding character should be fine though.
How about, additionally, adding __attribu
> On 14 Jun 2024, at 17:18, Tom Lane wrote:
>
> I wrote:
>> Seeing that this code is exercised thousands of times a day in the
>> regression tests and has had a failure rate of exactly zero (and
>> yes, the tests do check the output), there must be some reason
>> why it's okay.
>
> After looking
I wrote:
> Seeing that this code is exercised thousands of times a day in the
> regression tests and has had a failure rate of exactly zero (and
> yes, the tests do check the output), there must be some reason
> why it's okay.
After looking a little closer, I think the reason why it works in
pract
Daniel Gustafsson writes:
> This is indeed buggy and need to take the length into account, as per the
> attached. This only happens when in the undocumented regression test debug
> mode which may be why it's gone unnoticed.
Seeing that this code is exercised thousands of times a day in the
regre
>Thanks for looking! I will apply it backpatched all the way down as this has
>been wrong since 2006.
>
>> I wonder how Winter Loo got to see that warning...
>
I was compiling source code of postgres version 13 and the building flags is
changed in my development environment.
>And it would be int
> On 14 Jun 2024, at 10:29, Laurenz Albe wrote:
>
> On Fri, 2024-06-14 at 10:10 +0200, Daniel Gustafsson wrote:
>>> On 14 Jun 2024, at 10:06, Laurenz Albe wrote:
>>
>>> So you think we should ignore that compiler warning?
>>
>> We already do using this in meson.build:
>>
>> # Similarly disa
On Fri, 2024-06-14 at 10:10 +0200, Daniel Gustafsson wrote:
> > On 14 Jun 2024, at 10:06, Laurenz Albe wrote:
>
> > So you think we should ignore that compiler warning?
>
> We already do using this in meson.build:
>
> # Similarly disable useless truncation warnings from gcc 8+
> 'format-tru
> On 14 Jun 2024, at 10:06, Laurenz Albe wrote:
> So you think we should ignore that compiler warning?
We already do using this in meson.build:
# Similarly disable useless truncation warnings from gcc 8+
'format-truncation',
'stringop-truncation',
--
Daniel Gustafsson
On Fri, 2024-06-14 at 09:55 +0200, Daniel Gustafsson wrote:
> > On 14 Jun 2024, at 09:38, Winter Loo wrote:
>
> > I find the definition of `sqlca->sqlstate` and it has only 5 bytes. When
> > the statement
> >
> > ```c
> > strncpy(sqlca->sqlstate, "YE001", sizeof(sqlca->sqlstate));
> > ```
> >
On Fri, 2024-06-14 at 15:38 +0800, Winter Loo wrote:
> I am using gcc version 11.3.0 to compile postgres source code. Gcc complains
> about the following line:
>
> strncpy(sqlca->sqlstate, "YE001", sizeof(sqlca->sqlstate));
>
> with error as:
>
> misc.c:529:17: error: ‘strncpy’ output truncat
> On 14 Jun 2024, at 09:38, Winter Loo wrote:
> I find the definition of `sqlca->sqlstate` and it has only 5 bytes. When the
> statement
>
> ```c
> strncpy(sqlca->sqlstate, "YE001", sizeof(sqlca->sqlstate));
> ```
>
> get executed, `sqlca->sqlstate` will have no '\0' byte which makes me anxiou
Hi hackers,
I am using gcc version 11.3.0 to compile postgres source code. Gcc complains
about the following line:
```c
strncpy(sqlca->sqlstate, "YE001", sizeof(sqlca->sqlstate));
```
with error as:
misc.c:529:17: error: ‘strncpy’ output truncated before terminating nul copying
5 bytes fr
15 matches
Mail list logo