Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Feb 2015 08:35:24 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        kpneal@pobox.com
Cc:        freebsd-stable@freebsd.org, Brandon Allbery <allbery.b@gmail.com>
Subject:   Re: top, fixed buffer length in utils.c
Message-ID:  <3448299.k0XuYIUFXB@ralph.baldwin.cx>
In-Reply-To: <20150218025100.GA49517@neutralgood.org>
References:  <20150201175159.7fa88d16@B85M-HD3-0.alogt.com> <201502171657.07538.jhb@freebsd.org> <20150218025100.GA49517@neutralgood.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday, February 17, 2015 09:51:00 PM kpneal@pobox.com wrote:
> TL;DR: we shouldn't go littering our source tree with portability crap
> just to handle a case (64 bit ints) that is probably many, many years in
> the future.

Yeah, but I think char buf[sizeof(int) * 3 + 1] is actually less crappy than
char buf[10] despite it being more portable.  It is more obvious to the reader
what is happening.  Magic numbers are the least obvious thing to read and 
require more work for the reader to understand (hence needing a mult-line 
block comment to explain in this case).

-- 
John Baldwin



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