Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 May 1998 05:46:21 -0400 (EDT)
From:      Peter Dufault <dufault@hda.com>
To:        mike@smith.net.au (Mike Smith)
Cc:        jb@cimlogic.com.au, committers@FreeBSD.ORG
Subject:   Re: cvs commit: src/sys/sys termios.h
Message-ID:  <199805070946.FAA08739@hda.hda.com>
In-Reply-To: <199805062234.PAA00632@antipodes.cdrom.com> from Mike Smith at "May 6, 98 03:34:51 pm"

next in thread | previous in thread | raw e-mail | index | archive | help

> > To get a working FreeBSD/Alpha using a NetBSD kernel, I want to make as
> > few changes to FreeBSD sources as possible, and avoid destabilizing i386
> > in the process. On alpha, that means int is 32 bits, long is 64 bits.
> > Where there are variables in user-space that are passed to the kernel in
> > FreeBSD/NetBSD and the size of these variables differs when compiled on
> > alpha, I change the variable so that there is no effective change to i386.
> > This commonly means that things coded as long and used as 32-bit integers
> > are changed to int. And pointers that are cast to int are changed to cast
> > to long.
> 
> Is there a serious impediment to using *int32_t/*int64_t instead?  
> These give you explicitly-sized storage, and make it clear that you 
> mean them to stay that way...

(I'm actually USING termios.h in a 16 bit environment right now,
but it is a moot point since I'll never upgrade the one I'm using.)

Changing to "naked int" to mean "signed 32 bit" is backwards.  It
is discarding information.  In system headers
where the language doesn't require int behavior, I agree that using
typedefs for the two cases you describe is in order.

Expecting int to be >= 32 bits for new stuff is fine.

If there aren't many typedefs to change I'd make up descriptive
typedefs. If there are lots or I don't want to trouble my brain,
I'd not worry, be happy, and use int32_t.

Peter "1s and 0s?!?  We had to use only letter Os!" Dufault

-- 
Peter Dufault (dufault@hda.com)   Realtime development, Machine control,
HD Associates, Inc.               Safety critical systems, Agency approval

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



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