bin/71628: [PATCH] cleanup of the usr.sbin/rpcbind code
Giorgos Keramidas
keramida at freebsd.org
Mon Sep 13 02:00:50 PDT 2004
The following reply was made to PR bin/71628; it has been noted by GNATS.
From: Giorgos Keramidas <keramida at freebsd.org>
To: Dima Dorfman <dd at freebsd.org>
Cc: Dan Lukes <dan at obluda.cz>, bug-followup at freebsd.org
Subject: Re: bin/71628: [PATCH] cleanup of the usr.sbin/rpcbind code
Date: Mon, 13 Sep 2004 11:58:18 +0300
On 2004-09-13 06:46, Dima Dorfman <dd at freebsd.org> wrote:
> Dan Lukes <dan at obluda.cz> wrote:
> > Dima Dorfman wrote:
> > > Any initialization in the form "T v = v" invokes undefined behavior by
> > > using the indeterminate value of an object. Eliminating a warning or
> >
> > Unless compiler documentation say other ...
> > The v=v DURING DECLARATION (not later) is special case.
>
> I looked for such an exception in C99 before my original post, but I
> didn't find one.
There is a footnote in C99 that I'm a bit worried about. In page 37, a
footnote reads:
41) Thus, an automatic variable can be initialized to a trap
representation without causing undefined behavior, but the value of
the variable cannot be used until a proper value is stored in it.
Unless I'm mistaken, this means that the value of `foo' cannot be used in
the right part of the following assignment:
char *foo = foo;
> Do I sound like a pedant yet? ;-)
For a while, I was afraid my comments would sound unnecessarily pedantic
too. Fortunately, it seems I'm not.
More information about the freebsd-bugs
mailing list