GNU bug report logs -
#8545
issues with recent doprnt-related changes
Previous Next
Reported by: Paul Eggert <eggert <at> cs.ucla.edu>
Date: Mon, 25 Apr 2011 05:48:01 UTC
Severity: normal
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #35 received at 8545 <at> debbugs.gnu.org (full text, mbox):
On Thu, Apr 28, 2011 at 05:11, Paul Eggert <eggert <at> cs.ucla.edu> wrote:
>> would it be undefined behavior,
>> as long as the pointer has not been dereferenced?
>
> Yes. A portable C program is not allowed to create a pointer that
> doesn't point to an object, with the two exceptions of a null pointer
> and a pointer to the address immediately after an object.
That's weird, because it would mean that every pointer variable must
be initialized (either explicitly to some value, or implicitly to the
null pointer), or else the program will have undefined behavior.
Anyway, in this case fmt == format_end + 1 would point to the address
immediately after an object, wouldn't it?
> On
> some architectures, attempting to point to random addresses can cause
> exceptions or other undefined behavior.
On dereferencing, sure. But just on assignment to the pointer variable?
Juanma
This bug report was last modified 4 years and 251 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.