[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gnulib vasnprintf change introduced a bug
From: |
Thien-Thi Nguyen |
Subject: |
Re: gnulib vasnprintf change introduced a bug |
Date: |
Mon, 01 Sep 2014 07:55:01 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) |
() Paul Eggert <address@hidden>
() Sun, 31 Aug 2014 19:23:53 -0700
The recent change [...] introduced a bug because 'tmp + width'
has undefined behavior if the resulting pointer would fall
outside the containing buffer (this is true even though the
pointer is not dereferenced).
I believe the C11 spec describes this behavior in §6.5.6 ¶8,
"Additive Operators" (in my draft copy, at least). Is that
correct? Anywhere else i should look to learn more?
[...] better to use -Wno-sign-compare, as the signal-to-noise
ratio with -Wsign-compare is too high, and it's too tempting to
introduce bugs such as this one.
Yes, i surely fell for it.
That being said, I worked around this problem with the attached
further patch, which fixes somewhat-related issues that I also
noticed.
Thanks.
--
Thien-Thi Nguyen
GPG key: 4C807502
(if you're human and you know it)
read my lisp: (responsep (questions 'technical)
(not (via 'mailing-list)))
=> nil
signature.asc
Description: PGP signature
- Re: gnulib vasnprintf change introduced a bug,
Thien-Thi Nguyen <=