Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: Advantages of C Date: Wed, 20 Jul 2016 12:32:35 -0700 Organization: None to speak of Lines: 24 Message-ID: References: <87eg6rhrq6.fsf@bsb.me.uk> <87mvlehbm0.fsf@bsb.me.uk> <8737n49mcg.fsf@gmail.com> <3a54b2a3-7d87-4f0b-83e7-ca217cafbe1a@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="945944de09706c9b4e29b53c9d2efdc2"; logging-data="22330"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18E14qHdcrfNhOryYwr7JCD" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:i1lmyQkgQOgQxB6N4FGR7nr+e+0= sha1:alg+f7/KebkHvtSzZQkbx1Ni8tY= Xref: csiph.com comp.lang.c:90685 supercat@casperkitty.com writes: > On Wednesday, July 20, 2016 at 1:49:11 PM UTC-5, gwowen wrote: >> ... says the man who implemented an entire container library using void* >> pointers and essentially no type checking. > > On many platforms, all data pointers have the same representation; > nice implementations for such platforms allow a void** to be used to > manipulate any of them without regard for the target data type, but > reliable support for such things seems to have become unfashionable. On all platforms, a value of any pointer-to-object type can be converted to void* and back again without loss of information. (Independently of that, such conversions can be done implicitly.) I haven't studied jacob's container library, but I expect that it takes advantage of that without making any assumptions about pointer representation. [...] -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"