Path: csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!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: Tue, 04 Aug 2015 09:12:49 -0700 Organization: None to speak of Lines: 41 Message-ID: References: <662af1c4-4aff-4810-9a67-b913281fab59@googlegroups.com> <874mn5ty3y.fsf@kst-u.example.com> <87egm8qis7.fsf@kst-u.example.com> <55c09c2f.7188937@news.xs4all.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="945944de09706c9b4e29b53c9d2efdc2"; logging-data="25102"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/RG3/14XeEEt5Lw6bFyYii" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:FmCxNtEOdaLQzQ7hzUFmmkOkfBk= sha1:KBXAdV6Bt0KJSZRgaIgtGH2MchM= Xref: csiph.com comp.lang.c:66868 raltbos@xs4all.nl (Richard Bos) writes: > Keith Thompson wrote: >> David Brown writes: >> [...] >> > No one is asking for support for binary literals in printf, scanf, or >> > any other library functions (conversion to binary for output is simply >> > enough to do "manually" when needed). >> >> Well, I am. I favor adding 0b integer constants to the language *and* >> adding corresponding support to the library. > > Seconded. > > And if I may ask for another, please, sir? Can we also have the option, > suggested in another thread, for in- and outputting it using other > symbols than 1 and 0? > Particularly when coupled with Unicode (or even simple Extended ASCIIs > which include crosses and checks; or even ASCII itself with space and > 'X'!) this could be rather useful for outputting patterns of flags. I'm > thinking database lists, here, where e.g. the HR manager, typically > hostile to anything that looks technical, would look askance at a list > of employees that contained a slab of 001001011's, but if the columns of > employee bonus flags were included as " X X XX", it would be > acceptable. That could be done in code by using sprintf to create a string of 0s and 1s and then looping over them to change them to spaces and Xs. If you can persuade the committee to add your idea to the standard I won't object, but I personally don't think it carries its weight. For one thing, it seems insufficiently flexible. Sure, sometimes you want to print text consisting of spaces and Xs, but restricting the number of characters to the number of bits in the widest integer type (typically 64) seems arbitrary. -- 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"