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: double free Date: Fri, 15 Jul 2016 18:22:25 -0700 Organization: None to speak of Lines: 20 Message-ID: References: <8760sc2aiz.fsf@bsb.me.uk> <57856cf1.441531@news.xs4all.nl> <9cfaefc2-92a1-4e03-aa6b-d071a0988c87@googlegroups.com> <4gugob9jk24ovphk6kb8l9365pf8fap1nc@4ax.com> <87eg6vqb4y.fsf@bsb.me.uk> <87oa5yq4zz.fsf@bsb.me.uk> <87furapsy5.fsf@bsb.me.uk> <87shvamu5p.fsf@bsb.me.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="945944de09706c9b4e29b53c9d2efdc2"; logging-data="4499"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19YOvzRHNTvz2yTAPhw8JQa" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:pFe4wyJxp8/uglQxxq0ZG0/f2wE= sha1:4vR2HWqqokLVg26TrGfvpKbRADo= Xref: csiph.com comp.lang.c:90427 BartC writes: [...] > I think this is a flaw in the language where you can't distinguish one > type of T* from another, ie. pointing to a single T or to the first of > multiple Ts. The language makes no such distinction. For purposes of pointer arithmetic, an object of type T is treated as an array of type T[1]. I'm neither disputing nor agreeing with your statement that this is a flaw in the language, merely explaining how it's defined. I can see the benefit of a different kind of pointer that can point to an object but that isn't subject to arithmetic, but I'm not sure it's practical to add such a feature to C. -- 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"