comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: Is this ground dead? Also, info on Mach that's more recent
Date: 1998/01/19
Date: 1998-01-19T00:00:00+00:00	[thread overview]
Message-ID: <dewar.885247316@merv> (raw)
In-Reply-To: 34c39dc4.0@news1.ibm.net


Mark said

<<The C language has provided a syntax for bit fields since the late 70's.
The disadvantage of C's syntax viz Ada's is that you have to explicitly
insert dummy fields in the record if you want non-contiguous fields.
Conversely, C lacks the strong type checking that can make it more
difficult to work with bit fields in Ada.  I write these lines based in
personal experience:  without careful type definition, unchecked conversions
become rampant when Ada is used at the bit level.
>>

The C facilities are far more primitive. In particular the bit fields in
C can only be applies to integral types (you cannot use them for float
types, or even for enumeration types). Yes, you can rig things up with
bit fields, but it is often complex and implementation dependent to do so.


As for what can happen without careful type definition, rampant unchecked
conversions are the least of the problems. If there is one place where
care is needed (and good training and design sense counts for a lot) it
is in proper design of types.

Properly written low level code in Ada is cleaner and easier to read
than corresponding low level code in C, for the simple reason that Ada
provides more extensive facilities in this area.





  reply	other threads:[~1998-01-19  0:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <34AE2AE8.ED17B2C6@gildea.net>
     [not found] ` <5l3eir6lvj.fsf@tequila.systemsz.cs.yale.edu>
     [not found]   ` <69j8u6$spl$1@encore.ece.cmu.edu>
     [not found]     ` <5lzpky66rq.fsf@tequila.systemsz.cs.yale.edu>
     [not found]       ` <69jr4q$44j$1@encore.ece.cmu.edu>
1998-01-17  0:00         ` Is this ground dead? Also, info on Mach that's more recent Thomas G. McWilliams
1998-01-17  0:00           ` David A. Cuthbert
1998-01-17  0:00             ` Robert Dewar
1998-01-19  0:00               ` vonhend
1998-01-19  0:00                 ` Robert Dewar [this message]
1998-01-19  0:00             ` Anonymous
1998-01-19  0:00               ` feladdress.peter
1998-01-19  0:00                 ` Robert Dewar
1998-01-20  0:00                 ` Christopher Browne
1998-01-20  0:00                 ` Is this ground dead? Also, info on Mach that's more rec Jerry van Dijk
1998-01-22  0:00                 ` Compile-time type checking Nick Roberts
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox