Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!uc!cs.umn.edu!ux.acs!hopper From: hopper@ux.acs.umn.edu (hopper) Newsgroups: comp.std.c++ Subject: Re: Packing, Ordering, and Rearranging Message-ID: <2311@ux.acs.umn.edu> Date: 1 Oct 90 01:05:43 GMT References: <1407@lupine.NCD.COM> <2218@ux.acs.umn.edu> <57467@microsoft.UUCP> <1990Sep21.130531.7437@zorch.SF-Bay.ORG> <57650@microsoft.UUCP> <57681@microsoft.UUCP> Reply-To: hopper@ux.acs.umn.edu (Eric Hopper) Followup-To: <57681@microsoft.UUCP> Organization: Omnifarious Software Lines: 51 In article <57681@microsoft.UUCP> jimad@microsoft.UUCP (Jim ADCOCK) writes: Stuff deleted >Thank you. I think the suggestion we gravitated towards it that people >who need to bit-twiddle can do so within the confines of an : > >extern "C" >{ > .... >} > Stuff deleted > >My claim is that the needs of "C++" "object-oriented" programming and "C" >"bit-twiddling" will continue to diverge in the future, and we need to >separate these two needs. Extern "C" would serve to tell compilers which >set of needs are being met. > >In an extern "C" section, ANSI-C constraints would be met for ANSI-C constructs. >Outside of an extern "C" sections, those constraints might not be applicable. I don't think that this will be the case. As more and more programs are written in C++ that there will be more of a demand for 'bit-twiddling', particularily if operating systems and the like are written in it. I don't think structure declarations that demand precise control over placement of the bits within memory should be relegated to a patch-up contruct like 'extern "C" {', they should be part of C++. I also think that the default method of member ordering should be changed, it would cause confusion, and may make older code harder to port. So I think that a 'packed' keyword ought to be added to the C++ language. I think Kent made a very good point earlier when he said that currently popular languages all allow you to have a fair amount of precise control over the machine beneath the language. If C++ turns into a 'school' language in which you are not allowed control over such things as structure member placement I think we'll see a loss of popularity, and portability. Have fun, UUCP: rutgers!umn-cs!ux.acs.umn.edu!hopper (Eric Hopper) __ /) /**********************/ / ') // * I went insane to * / / ______ ____ o // __. __ o ____. . _ * preserve my sanity * (__/ / / / <_/ / <_<__//__(_/|_/ (_<_(_) (_/_/_)_ * for later. * Internet: /> * -- Ford Prefect * hopper@ux.acs.umn.edu /**********************/ -- -- Nils_McCarthy mtymp01@ux.acs.umn.edu rutgers!umn-cs!ux.acs.umn.edu!mtymp01 "The wonders of modern technology..." :-) :-) :-)