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


Groups > comp.std.c > #1751

Re: null pointer constant, address constant

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!newsfeed.straub-nv.de!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail
From James Kuyper <jameskuyper@verizon.net>
Newsgroups comp.std.c
Subject Re: null pointer constant, address constant
Date Tue, 18 Dec 2012 15:54:12 -0500
Organization A noiseless patient Spider
Lines 23
Message-ID <50D0D7F4.5080502@verizon.net> (permalink)
References <kapqt2$es4$1@speranza.aioe.org> <kaqekj$8st$1@dont-email.me> <kaqiia$gvn$1@speranza.aioe.org>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding 7bit
Injection-Info mx04.eternal-september.org; posting-host="d8fef572ea43a1acd556896aa70d63af"; logging-data="22648"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18ePAN1HfdyHokoKIyY6laNwbuGhBGsgLw="
User-Agent Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/17.0 Thunderbird/17.0
In-Reply-To <kaqiia$gvn$1@speranza.aioe.org>
Cancel-Lock sha1:0Ahiow2zM7O9bRqaPT+eSuayufc=
Xref csiph.com comp.std.c:1751

Show key headers only | View raw


On 12/18/2012 03:09 PM, Szabolcs Nagy wrote:
> Shao Miller <sha0.miller@gmail.com> wrote:
>> On 12/18/2012 08:25, Szabolcs Nagy wrote:
>>> but (for me at least) it's more surprising that this is
>>> not even a constant expression that can be used in
>>> initializers, ie.
>>>
>>>   void *p = 0?(void*)0:(void*)0;
>>>
>>
>> Why not?  6.6p7 says an initializer can evaluate to an address constant. 
>>  6.6p9 says an address constant can be a null pointer.  Your ternary 
> 
> you are rigth, thanks
> 
> i was wrong about initializers

"An address constant ... shall be created explicitly using
the unary & operator or an integer constant cast to pointer type, or
implicitly by the use of an expression of array or function type."
(6.6p9). (void*)0 fits the second option, so that expression contains
two address constants as sub-expressions, but the ?: expression itself
doesn't fit any of the three options.

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


Thread

null pointer constant, address constant Szabolcs Nagy <nsz@port70.net> - 2012-12-18 13:25 +0000
  Re: null pointer constant, address constant James Kuyper <jameskuyper@verizon.net> - 2012-12-18 09:53 -0500
    Re: null pointer constant, address constant Szabolcs Nagy <nsz@port70.net> - 2012-12-18 20:06 +0000
      Re: null pointer constant, address constant James Kuyper <jameskuyper@verizon.net> - 2012-12-18 15:39 -0500
        Re: null pointer constant, address constant Szabolcs Nagy <nsz@port70.net> - 2012-12-19 00:44 +0000
          Re: null pointer constant, address constant James Kuyper <jameskuyper@verizon.net> - 2012-12-18 20:24 -0500
            Re: null pointer constant, address constant Szabolcs Nagy <nsz@port70.net> - 2012-12-19 10:27 +0000
              Re: null pointer constant, address constant James Kuyper <jameskuyper@verizon.net> - 2012-12-19 07:15 -0500
              Re: null pointer constant, address constant Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2012-12-21 03:03 +0200
                Re: null pointer constant, address constant James Kuyper <jameskuyper@verizon.net> - 2012-12-21 12:13 -0500
                Re: null pointer constant, address constant Szabolcs Nagy <nsz@port70.net> - 2013-01-09 00:44 +0000
                Re: null pointer constant, address constant James Kuyper <jameskuyper@verizon.net> - 2013-01-08 20:21 -0500
                Re: null pointer constant, address constant Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-01-08 20:46 -0500
          Re: null pointer constant, address constant Shao Miller <sha0.miller@gmail.com> - 2012-12-18 20:37 -0500
      Re: null pointer constant, address constant Shao Miller <sha0.miller@gmail.com> - 2012-12-18 16:15 -0500
        Re: null pointer constant, address constant Keith Thompson <kst-u@mib.org> - 2012-12-18 15:52 -0800
          Re: null pointer constant, address constant Shao Miller <sha0.miller@gmail.com> - 2012-12-18 19:12 -0500
            Re: null pointer constant, address constant Shao Miller <sha0.miller@gmail.com> - 2012-12-18 19:51 -0500
          Re: null pointer constant, address constant Keith Thompson <kst-u@mib.org> - 2012-12-18 17:02 -0800
          Re: null pointer constant, address constant "christian.bau" <christian.bau@cbau.wanadoo.co.uk> - 2012-12-20 05:34 -0800
            Re: null pointer constant, address constant James Kuyper <jameskuyper@verizon.net> - 2012-12-20 10:33 -0500
              Re: null pointer constant, address constant James Kuyper <jameskuyper@verizon.net> - 2012-12-20 12:28 -0500
                Re: null pointer constant, address constant Tim Rentsch <txr@alumni.caltech.edu> - 2012-12-20 21:13 -0800
              Re: null pointer constant, address constant Tim Rentsch <txr@alumni.caltech.edu> - 2012-12-20 21:05 -0800
            Re: null pointer constant, address constant Shao Miller <sha0.miller@gmail.com> - 2012-12-20 12:17 -0500
            Re: null pointer constant, address constant Keith Thompson <kst-u@mib.org> - 2012-12-20 12:10 -0800
              Re: null pointer constant, address constant Tim Rentsch <txr@alumni.caltech.edu> - 2012-12-20 21:25 -0800
  Re: null pointer constant, address constant Shao Miller <sha0.miller@gmail.com> - 2012-12-18 14:02 -0500
    Re: null pointer constant, address constant Szabolcs Nagy <nsz@port70.net> - 2012-12-18 20:09 +0000
      Re: null pointer constant, address constant James Kuyper <jameskuyper@verizon.net> - 2012-12-18 15:54 -0500
        Re: null pointer constant, address constant Shao Miller <sha0.miller@gmail.com> - 2012-12-18 16:18 -0500

csiph-web