From owner-freebsd-current Tue Nov 16 1:43:32 1999 Delivered-To: freebsd-current@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 00C0814CC5 for ; Tue, 16 Nov 1999 01:43:27 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from p123-ts5.syd2.zeta.org.au (beefcake.zeta.org.au [203.26.10.12]) by mailman.zeta.org.au (8.8.7/8.8.7) with ESMTP id UAA24382; Tue, 16 Nov 1999 20:49:39 +1100 Date: Tue, 16 Nov 1999 20:42:52 +1100 (EST) From: Bruce Evans X-Sender: bde@alphplex.bde.org To: Pierre Beyssac Cc: Garrett Wollman , Sheldon Hearn , freebsd-current@FreeBSD.ORG Subject: Re: egcs -O breaks ping.c:in_cksum() In-Reply-To: <19991116094536.A44999@enst.fr> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tue, 16 Nov 1999, Pierre Beyssac wrote: > On Tue, Nov 16, 1999 at 03:17:43PM +1100, Bruce Evans wrote: > > On Mon, 15 Nov 1999, Pierre Beyssac wrote: > > > - volatile u_short answer = 0; > > > + union { > > > + u_int16_t us; > > > + u_int8_t uc[2]; > > > + } answer; > > > > This has indentation bugs. > > Uh, which one(s) do you mean exactly? The 4-space indented union > (I just followed style(9)) or the double space before uc[2] (it > was just to align us and uc vertically)? See Sheldon's reply. u_int16_t and u_int8_t are too wide for the normal indentation rules to apply. Various inconsistent formattings are used for them. E.g., in Lite2, uses an extra space in one struct and an extra tab in the others. This is another reason to use u_short :-). > > ping.c still assumes that u_short is u_int16_t everywhere else. > > But in_cksum() is more or less self-contained. Probably it's more > consistent (even withing in_cksum which uses u_short elsewhere) to > change back the union to u_short and u_char, though. There are better examples to copy in the kernel. They still use too many shorts, ints and union hacks, however. The alpha version is most interesting. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message