kern/175759: Correct data types for fields of struct qm_trace{} from <sys/queue.h>

Gleb Smirnoff glebius at FreeBSD.org
Tue Feb 5 12:10:01 UTC 2013


The following reply was made to PR kern/175759; it has been noted by GNATS.

From: Gleb Smirnoff <glebius at FreeBSD.org>
To: Andrey Simonenko <simon at comsys.ntu-kpi.kiev.ua>
Cc: Bruce Evans <brde at optusnet.com.au>, FreeBSD-gnats-submit at freebsd.org
Subject: Re: kern/175759: Correct data types for fields of struct qm_trace{}
 from <sys/queue.h>
Date: Tue, 5 Feb 2013 16:02:18 +0400

 On Tue, Feb 05, 2013 at 01:35:50PM +0200, Andrey Simonenko wrote:
 A> > Unsigned long is unnecessarily large.  It wastes space on 64-bit
 A> > arches.  The change doesn't change the wastage, because space was
 A> > already wasted on 64-bit arches by mispacking the struct (with
 A> > unnamed padding after the ints).  It changes the API unnecessarily
 A> > by changing signed variables to unsigned.  Sign variables are
 A> > easier to use, and changing to unsigned ones risks sign extension
 A> > bugs.
 A> 
 A> I did not change order of fields to not change API, that's why
 A> bigger data type is used without changing size of that structure
 A> due to padding (at least for current sizes of int and long).
 
 We don't claim to be ABI stable for binaries that contain additional
 debugging information. They don't go into releases, and they alredy
 are incompatible with non-debugging binaries.
 
 So this isn't a problem.
 
 
 -- 
 Totus tuus, Glebius.


More information about the freebsd-bugs mailing list