[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/6] common: move standard C fixed width type declarations to common header
- To: Jan Beulich <jbeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 9 Feb 2023 09:23:04 -0500
- Arc-authentication-results: i=1; mx.zohomail.com; dkim=pass header.i=apertussolutions.com; spf=pass smtp.mailfrom=dpsmith@xxxxxxxxxxxxxxxxxxxx; dmarc=pass header.from=<dpsmith@xxxxxxxxxxxxxxxxxxxx>
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675952601; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=hdeCoY/YoXDXf/A4m7BydX1bIlOrLfHRzkWbqt74sEE=; b=jMFJQLkZNlOu/wuLuWDlg42/CpSKTDdaTegHmIGhx95tUi6wJf4BSyfu95bkSaa9A3xE9uzFccugIhjuBFtlFj+QIoYQo2N3OLt8LyNbE4dgvZGS2dGKndATLZcCSijLp0qsmavLB8cru18Oii+lnJuBOI1IhDBqbO9oW54lb8g=
- Arc-seal: i=1; a=rsa-sha256; t=1675952601; cv=none; d=zohomail.com; s=zohoarc; b=b8NPf8768ZiwPMXtR7cM+wQKzDM9DBoqus8bta44MSQNZ6bGIdpQOmYazuyD99iMcsNfI+peOKpASWqpXpKcm7YNxkcIyVVESN0IXBj2Ke37+OC5nZbGdwCPiT1oLGKwndD0rLPWWHww/fxNVQ/oS4vQixcCmNDwNIspZpC/NVU=
- Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Bobby Eshleman <bobbyeshleman@xxxxxxxxx>, Alistair Francis <alistair.francis@xxxxxxx>, Connor Davis <connojdavis@xxxxxxxxx>, Paul Durrant <paul@xxxxxxx>
- Delivery-date: Thu, 09 Feb 2023 14:23:41 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 2/9/23 05:38, Jan Beulich wrote:
Have these in one place, for all architectures to use. Also use the C99
types as the "original" ones, and derive the Linux compatible ones
(which we're trying to phase out). For __s<N>, seeing that no uses exist
anymore, move them to a new Linux compatibility header (as an act of
precaution - we don't have any uses of these types right now).
Modern compilers supply __{,U}INT<n>_TYPE__ - use those if available.
Otherwise fall back to using "mode" attributes, but this can be relied
upon only when bytes are 8 bits wide. Should there ever be a port to an
architecture not matching this, it would need to define the fixed width
types locally by some other means.
In a few cases inclusion of asm/types.h needs replacing by xen/types.h.
Further in common/trace.c take the opportunity and also drop the
apparently unused inclusion of asm/io.h at the same time. Finally in
some Flask sources inclusion of asm/byteorder.h needs moving later.
No functional change intended.
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
---
RFC: I know Andrew would prefer these types to move to a new
xen/stdint.h, but not being fully convinced of this myself, I was
hoping for others to voice views.
IHHO since there is already stdarg.h and stdbool.h, which establishes
some degree of following C standard library includes, it would seem more
logical to move to stdint.h. The main point here is not whether
following the C standard library includes is the right approach, but
that consistency is more important. Having a mixture of types.h and C
standard library includes leaves one having to keep track of which C
standard library includes are present versus what is in type.h.
|