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: Sun, 24 Jul 2016 02:55:52 -0700 Organization: None to speak of Lines: 45 Message-ID: References: <5793313b.2453031@news.xs4all.nl> <87fur0acpk.fsf@bsb.me.uk> <4b97df6b-97ec-4ce8-a263-cbc75f84d335@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="945944de09706c9b4e29b53c9d2efdc2"; logging-data="29422"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18DtCIkX6vnO6K1BWWijsJX" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:SsLtZVzGfN0r/X2JlVMqLescxco= sha1:YE9UEOy7j0zaLMWJSSMlsIRkL8Q= Xref: csiph.com comp.lang.c:90892 BartC writes: > On 24/07/2016 04:55, Keith Thompson wrote: >> luser droog writes: > >>> What he said (IIRC) was ditch the parens and use spaces. You should >>> know (or being willing to learn) the relative precedences of the >>> operators that you use in an expression. And you should use spaces >>> to demonstrate what you (the programmer) intend. > >> A more relevant example might be: >> x | y ^ z >> That expression is entirely unambiguous as far as the C standard is >> concerned. Tim would argue that a C programmer would know that it's >> equivalent to >> x | (y ^ z) >> and in principle I agree, > >> I would certainly advocate using parentheses in that case. >> BartC inferred that Tim would recommend *not* using parentheses. > > How, after all that's said above, can you doubt that Tim would not use > or recommend parentheses? What purpose would they serve if everyone > involved, coders, readers and maintainers, knows the precedences INSIDE > OUT? (I would start worrying about your job I think if you don't know them!) I simply don't know, that's all. > (And in your example, if no one - or no ordinary programmer with a job > to do and familiar with multiple languages - can think off-hand why the > precedence of ^ should be more or less than | for example, then I don't > agree they should be different at all.) You don't agree with whom? Has anyone here said that ^ *should* have higher precedence than |? Or do you just mean you disagree with the way C defines them? > Anyway, we might learn the answer in a couple of months (maybe he works > on a ship and can only post when he's in port or something). But then, > he doesn't always like answering such direct questions. -- 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"