Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: Spurious diagnostic messages Date: Sun, 04 Oct 2015 15:56:33 -0700 Organization: None to speak of Lines: 56 Message-ID: References: <874mn5ty3y.fsf@kst-u.example.com> <87egm8qis7.fsf@kst-u.example.com> <45crratneenjh9ktjt1l8ioskb7ehrr8e5@4ax.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="945944de09706c9b4e29b53c9d2efdc2"; logging-data="28070"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18C8Y/+ZA/lFEJ0poXUSkjA" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:D3w8JmbyqDtvWjsv0PKPg2Jik2Y= sha1:HQL2GZvX6zDVEmBJj3aaylyM+q0= Xref: csiph.com comp.lang.c:71886 Tim Rentsch writes: > Keith Thompson writes: >> Tim Rentsch writes: >> [...] >>> An important phrase in what I said is "that provides no >>> capability beyond what is fairly easily available otherwise". >>> The math stuff doesn't fall into this category, whereas >>> binary constants do. >> >> You assert that binary constants don't provide a capability that >> is fairly easily available othrwise. I disagree. > > If what we're talking about is being able to write an integer > constant in binary (aka base 2), the short macro definition I > posted recently demonstrates that this can be done in standard C, > without adding any new construct to the language. Defining such > a macro can be done in a fairly obvious and straightforward way > (the one I posted was a little bit clever, but it doesn't have to > be that clever to be workable). What part of this don't you > agree with? I disagree that defining a macro that implements the equivalent of binary constants is sufficiently obvious or straightforward. Depending on how such a macro is defined, it might fail quietly if you use it with the wrong number of digits. If I'm reading code that uses such a macro, I have to spend time understanding how the macro works. If the code seems to be behaving incorrectly, an incorrect macro definition is one more possible cause to investigate. Different programmers will define different macros. Actually, most programmers don't bother, because it's too much effort. Providing binary constants as a language feature solves both problems. [...] > What I think you're saying is that you would rather use binary > constants defined as a new language construct than one of the > other options (such as the macro alternative) now available in > standard C. I accept that this is an accurate statement of > your preference, but it doesn't invalidate my assertion that > the ability to write constants in binary is fairly easily > available without having to add said construct to the language. > Do you agree with this? Or have I misunderstood what you're > trying to say? Pretty much, though I disagree that it's "fairly easy". I find that it's difficult enough that it's rarely worth the effort. -- 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"