Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Apr 2002 22:45:28 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Alexander Leidinger <Alexander@Leidinger.net>
Cc:        obrien@FreeBSD.ORG, <current@FreeBSD.ORG>
Subject:   Re: libkern/quad.h
Message-ID:  <20020410223615.B264-100000@gamplex.bde.org>
In-Reply-To: <200204100945.g3A9j1HA000728@Magelan.Leidinger.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 10 Apr 2002, Alexander Leidinger wrote:

> As for other occourences of the use of __GNUC__ without a check if it is
> defined: I will wrap them as soon as I review my own patches again.

Other occurrences are mostly correct.  __GNUC__ is 0 in cpp expressions
if it is used without it being defined.  The problem with the ifdef in
quad.h is that it defaults to the gcc-1 case if __GNUC__ is not >= 2.
The ifdef should have been written something like:

#if __GNUC__ == 1
typedef	u_quad_t	qshift_t;
#else
typedef	u_int		qshift_t;
#endif

assuming that u_int really is "correct" for shift counts.  (Shift counts
can be of any integer type; it is just not useful to use a large type
for them since shifting by an amount larger than the number of bits in
the operand being shifted is undefined.)

Bruce


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020410223615.B264-100000>