C99: Suggestions for style(9)

Bruce Cran bruce at cran.org.uk
Fri May 1 08:41:40 UTC 2009


On Fri, 01 May 2009 01:30:26 -0700
Julian Elischer <julian at elischer.org> wrote:

> Christoph Mallon wrote:
> >>
> >> 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'.  However, we have enough where this isn't
> > 
> > You're mistaken, this is perfectly legal C. See ISO/IEC 9899:1999
> > (E) §6.8.2:1. In short: you can mix statements and declarations.
> 
> now, but not all C compilers are C99 and a lot of FreeBSD code
> is taken and run in other situations. There is FreeBSD code
> in all sorts of environments, not all of which have new compilers.
> 

Doesn't FreeBSD already use C99 features such as stdint and named
initializers?  I don't think sys/cam/scsi/scsi_ses.c would
compile with a C89 compiler for example.

-- 
Bruce Cran


More information about the freebsd-hackers mailing list