1 May 2009 02:37
Re: C99: Suggestions for style(9)
M. Warner Losh <imp <at> bsdimp.com>
2009-05-01 00:37:27 GMT
2009-05-01 00:37:27 GMT
In message: <20090430233648.GA95360 <at> keira.kiwi-computer.com>
"Rick C. Petty" <rick-freebsd2008 <at> kiwi-computer.com> writes:
: On Thu, Apr 30, 2009 at 09:02:26AM -0600, M. Warner Losh wrote:
: >
: > This is the biggest one, and I think it may be too soon. Also, we
: > need to be careful on the initialization side of things because we
: > currently have a lot of code that looks like:
: >
: >
: > struct foo *fp;
: > struct bar *bp;
: >
: > fp = get_foo();
: > if (!fp) return;
: > bp = fp->bp;
: >
: > this can't easily be translated to the more natural:
: >
: > struct foo *fp = get_foo();
: > struct bar *bp = fp->bp;
: >
: > since really you'd want to write:
: >
: > struct foo *fp = get_foo();
: > if (!fp) return;
: > struct bar *bp = fp->bp;
: >
: > which isn't legal in 'C'.
:
: I thought we were talking about C99, in which case this is perfectly legal.
(Continue reading)
RSS Feed