Path: csiph.com!news.swapon.de!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: Extending C with GC? Date: Thu, 04 Aug 2016 12:30:47 -0700 Organization: None to speak of Lines: 20 Message-ID: References: <60b33d17-71b7-4ecf-a821-dc641e2673ba@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="945944de09706c9b4e29b53c9d2efdc2"; logging-data="11895"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18RgCaNSp94R8uMT3TaXWTi" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:Crm9kS8bvyauNhkNK2In1mUa9Bg= sha1:vf6UxQRrdFnJ97nYtOtz2m9fuUs= Xref: csiph.com comp.lang.c:91669 supercat@casperkitty.com writes: [...] > A slight variation on the above, which would bring things closer to full > conformance, would require that sizeof(any pointer) be equal to 1, but > type "char" would be capable of holding either a number or a pointer, > with a "hidden" bit that identified which it held. Using any arithmetic > operator on a "char" value would clear the "is a pointer" bit, and there > would be no means via which user code could set that bit except via > operations that yield validated pointers. You suggest (for this subset) requiring all pointers to have a size of 1 bytes, and type `char` to be able to hold a pointer? Why `char`? Why not, say, `uintptr_t` (with whatever size it happens to have, typically 4 or 8)? -- 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"