Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #76919

Re: howmany -- What the F**k ?

From James Kuyper <jameskuyper@verizon.net>
Newsgroups comp.lang.c
Subject Re: howmany -- What the F**k ?
Date 2015-11-22 16:18 -0500
Organization Self
Message-ID <56523110.3000300@verizon.net> (permalink)
References <XnsA556C180B2E15jamesdowallen@178.63.61.175> <lnegfkews0.fsf@kst-u.example.com> <MPG.30bae728ff5b26669a@news.eternal-september.org> <5651DAA1.6030609@verizon.net> <lnr3jh4vtm.fsf@kst-u.example.com>

Show all headers | View raw


On 11/22/2015 03:34 PM, Keith Thompson wrote:
> James Kuyper <jameskuyper@verizon.net> writes:
>> On 11/21/2015 11:40 PM, Philip Lantz wrote:
>>> Keith Thompson wrote:
>>>> James Dow Allen writes:
>>>>> sys/types.h has
>>>>> 	#define  howmany(x,y)    (((x)+((y)-1))/(y))
>>>>
>>>> Reported: https://cygwin.com/ml/cygwin/2015-11/msg00293.html
>>>
>>> The proposed fix in that thread appears to be to use _howmany instead
>>> of howmany. That's not an improvement...
>>
>> Why not? I thought the original complaint was about the conflict with a
>> user-defined identifier with the same name. Users have no right to
>> expect a lack of conflict if they use identifiers with file scope that
>> start with an underscore. (7.1.3p1).
> 
> I believe this program is strictly conforming.  It defines the
> identifier _howmany at block scope.
> 
>     #include <stdio.h>
>     void func(void) { }
>     int main(void) {
>         void (*_howmany)(void) = func;
>         _howmany();
>     }
> 
> If including <stdio.h> results in the definition of a function-like
> macro named "_howmany" that requires one or more arguments, then the
> program will fail to compile, which implies that the implementation
> is non-conforming.

You're right - for a macro they need an identifier that is reserved "for
all uses", not just at file scope. I should have thought of that.

Back to comp.lang.c | Previous | Next — Previous in thread | Find similar | Unroll thread


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