svn commit: r291741 - head/sys/geom

Bruce Evans brde at optusnet.com.au
Fri Dec 4 21:09:21 UTC 2015


On Fri, 4 Dec 2015, Bryan Drewery wrote:

> On 12/4/2015 10:03 AM, Bruce Evans wrote:
>> This is specified by not giving an example of using it.  style(9) was
>
> I really take issue with this stance. I don't think you really mean what
> this implies. For example, can I even use 'x++' or mtx_lock(9) or
> uintptr_t since they are not shown in an example?

mtx_lock() is just another function, so it doesn't need an example any
more than printf().  printf() also happens to have no example, but there
is a formal rule for it an example for fprintf().

'++' is just a standard operator.  style(9) happens to have an example
of it, though not on a variable named x.  It even has the bad example
of ++p instead of p++ where the result is not used.  ++p is more logical
and I used to prefer it, but only p++ is KNF-normal.

style(9) has even more detailed rules for uintXX_t, but no examples,
and nothing for uintptr_t.  uintptr_t can be considered as just another
typedef.  The rule about uintXX_t is mainly part of deprecating the
old spelling u_intXX_t.

I wouldn't trust style(9) for anything except simple formatting, but
look at the subsystem(s) style.  Just the top level of geom has 11000+
lines which can be considered as giving about 20 times more examples
than style(9).

Bruce


More information about the svn-src-head mailing list