Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | Eric Sosman <esosman@comcast-dot-net.invalid> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: howmany -- What the F**k ? |
| Date | 2015-11-18 07:52 -0500 |
| Organization | A noiseless patient Spider |
| Message-ID | <n2hs6p$467$1@dont-email.me> (permalink) |
| References | <XnsA556C180B2E15jamesdowallen@178.63.61.175> |
On 11/18/2015 7:01 AM, James Dow Allen wrote:
> I run gcc under cygwin and recently discovered something that made me
> furious^H^H^H^H^H^H^H^H^H^H^H annoyed me a little.
>
> I named a function howmany(). Not __howmany() or HoWmAnY() or
> ___SYS__howmanY() or whatever the reserving rules prohibit, just
> howmany().
>
> Of course I got a weird syntax error and immediately guessed what was
> wrong. I changed the function name to howmany_and_fuk_you_too(), and it
> worked. But I still took the time to track it down. Note that one can
> imagine situations where debugging would have been harder.
>
> sys/types.h has
> #define howmany(x,y) (((x)+((y)-1))/(y))
>
> The problem was caused by my including stdio.h, a header I barely use.
> I see that it is
> " Copyright (c) 1990 The Regents of the University of California."
> stdio.h includes sys/types.h which doesn't deign to identify its
> source or copyright owner, though other headers in the same directory
> mention "Red Hat, Inc." and "CYGWIN_LICENSE."
>
> (Trying to play like the pedants, I even include stdlib.h -- a header
> which has absolutely no value to me except suppressing an inane warning
> about exit(). Perhaps I should stop including it before its zillions of
> garbage defines find a way of causing more trouble.)
>
> So my questions are:
>
> (1) Do any of you ever use the RedHat/Whatever howmany() ?
> I often need that facility but ... gasp! ... invest several hundred
> milliseconds to type out the arithmetic myself. Or, gasp, write my own
> inane macros in my own inane header file using names and usages, gasp,
> convenient for me.
>
> (2) Should such garbage be given reserved names like
> ___WHATEVER___howmany() ?
> (I'm uninterested in details about "reserved names" -- I don't
> think "howmany" is reserved and that's what I'm talking about.)
>
> Whatever genius defined howmany for me isn't the only problem.
> j0, j1, yn etc. have been shitcanned for decades as soon as you
> include math.h -- I guess the fear there was that bessel_j0()
> would be less descriptive than j0().
>
>
> Comments?
Correctness meets reality, and correctness loses out.
`howmany' and the other names you mentioned belong to the
programmer, not to the Standard or to the implementation. An
implementation that declares them is non-conforming (unless
it's specifically been asked to do so, e.g., by inclusion of
a non-Standard header).
I fooled around with various -std= settings and with -pedantic,
but found no combination that suppressed the bogus declaration.
Sloppy work in the headers, I guess, but ...
... correctness loses out.
--
esosman@comcast-dot-net.invalid
"Don't be afraid of work. Make work afraid of you." -- TLM
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
howmany -- What the F**k ? James Dow Allen <gmail@jamesdowallen.nospam> - 2015-11-18 12:01 +0000
Re: howmany -- What the F**k ? Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-11-18 07:52 -0500
Re: howmany -- What the F**k ? "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-11-18 05:14 -0800
Re: howmany -- What the F**k ? Keith Thompson <kst-u@mib.org> - 2015-11-18 08:26 -0800
Re: howmany -- What the F**k ? Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-11-18 11:44 -0500
Re: howmany -- What the F**k ? Keith Thompson <kst-u@mib.org> - 2015-11-18 09:08 -0800
Re: howmany -- What the F**k ? James Kuyper <jameskuyper@verizon.net> - 2015-11-18 08:31 -0500
Re: howmany -- What the F**k ? Keith Thompson <kst-u@mib.org> - 2015-11-18 08:25 -0800
Re: howmany -- What the F**k ? James Dow Allen <jdallen2000@yahoo.com> - 2015-11-18 11:58 -0800
Re: howmany -- What the F**k ? Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-11-18 15:14 -0500
Re: howmany -- What the F**k ? James Dow Allen <jdallen2000@yahoo.com> - 2015-11-18 17:48 -0800
Re: howmany -- What the F**k ? James Kuyper <jameskuyper@verizon.net> - 2015-11-18 21:06 -0500
Re: howmany -- What the F**k ? Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-11-19 08:23 -0500
Re: howmany -- What the F**k ? Keith Thompson <kst-u@mib.org> - 2015-11-19 21:45 -0800
Re: howmany -- What the F**k ? Tim Rentsch <txr@alumni.caltech.edu> - 2015-11-20 12:55 -0800
Re: howmany -- What the F**k ? Keith Thompson <kst-u@mib.org> - 2015-11-20 03:27 -0800
Re: howmany -- What the F**k ? Philip Lantz <prl@canterey.us> - 2015-11-21 20:40 -0800
Re: howmany -- What the F**k ? James Kuyper <jameskuyper@verizon.net> - 2015-11-22 10:09 -0500
Re: howmany -- What the F**k ? Philip Lantz <prl@canterey.us> - 2015-11-22 10:18 -0800
Re: howmany -- What the F**k ? gazelle@shell.xmission.com (Kenny McCormack) - 2015-11-22 18:35 +0000
Re: howmany -- What the F**k ? Philip Lantz <prl@canterey.us> - 2015-11-22 13:10 -0800
Re: howmany -- What the F**k ? James Kuyper <jameskuyper@verizon.net> - 2015-11-22 13:57 -0500
Re: howmany -- What the F**k ? Philip Lantz <prl@canterey.us> - 2015-11-22 13:02 -0800
Re: howmany -- What the F**k ? James Kuyper <jameskuyper@verizon.net> - 2015-11-22 16:15 -0500
Re: howmany -- What the F**k ? James Kuyper <jameskuyper@verizon.net> - 2015-11-23 06:33 -0500
Re: howmany -- What the F**k ? gazelle@shell.xmission.com (Kenny McCormack) - 2015-11-23 12:17 +0000
Re: howmany -- What the F**k ? Philip Lantz <prl@canterey.us> - 2015-11-23 21:09 -0800
Re: howmany -- What the F**k ? Keith Thompson <kst-u@mib.org> - 2015-11-22 12:34 -0800
Re: howmany -- What the F**k ? James Kuyper <jameskuyper@verizon.net> - 2015-11-22 16:18 -0500
csiph-web