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


Groups > comp.lang.c > #76321

Re: Issue on assigning address to pointers

Path csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail
From Keith Thompson <kst-u@mib.org>
Newsgroups comp.lang.c
Subject Re: Issue on assigning address to pointers
Date Tue, 17 Nov 2015 15:05:47 -0800
Organization None to speak of
Lines 25
Message-ID <ln6110jkfo.fsf@kst-u.example.com> (permalink)
References <dc62f43a-1725-496b-b36a-c3e196015b7d@googlegroups.com> <lnegfojzfu.fsf@kst-u.example.com> <d581d91c-402d-49ac-8c96-4587c79ab5d9@googlegroups.com> <n2fsfj$eth$1@dont-email.me>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Injection-Info mx02.eternal-september.org; posting-host="945944de09706c9b4e29b53c9d2efdc2"; logging-data="17096"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18yC6/G0xZYOP6qOCs4WpzQ"
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)
Cancel-Lock sha1:gNwrZMqr8dmhKZJPJmF6DfyFsHA= sha1:M9CXcPaQFS3wQwQD2zfpR0JAL+k=
Xref csiph.com comp.lang.c:76321

Show key headers only | View raw


Richard Heathfield <rjh@cpax.org.uk> writes:
> On 17/11/15 18:32, Alla _ wrote:
[...]
>> whereas auto or local variables are guaranteed to be garbage:
>
> No such guarantee is provided. Rather, uninitialised objects have an 
> indeterminate value (i.e. you can't tell what it is) until such time as 
> a value is assigned to them. C does not define what will happen if your 
> program reads an indeterminate value.
[...]

It depends on what you mean by "garbage", I suppose.  One reasonable
interpretation is that "guaranteed to be garbage" means that there's no
guarantee at all.  There's similar wording in K&R2, though not using the
word "guaranteed".  (The phrase "guaranteed to be garbage" sounds
familiar; it might be in K&R1.)

There are also cases where accessing a "garbage" value has undefined
behavior, so it goes beyond just having some arbitrary value.

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
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"

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


Thread

Issue on assigning address to pointers Alla _ <modelling.data@gmail.com> - 2015-11-17 08:49 -0800
  Re: Issue on assigning address to pointers James Kuyper <jameskuyper@verizon.net> - 2015-11-17 12:36 -0500
    Re: Issue on assigning address to pointers Richard Heathfield <rjh@cpax.org.uk> - 2015-11-17 17:47 +0000
      Re: Issue on assigning address to pointers Alla _ <modelling.data@gmail.com> - 2015-11-17 10:34 -0800
        Re: Issue on assigning address to pointers Keith Thompson <kst-u@mib.org> - 2015-11-17 12:16 -0800
        Re: Issue on assigning address to pointers James Kuyper <jameskuyper@verizon.net> - 2015-11-17 15:23 -0500
    Re: Issue on assigning address to pointers Alla _ <modelling.data@gmail.com> - 2015-11-17 10:33 -0800
  Re: Issue on assigning address to pointers Keith Thompson <kst-u@mib.org> - 2015-11-17 09:41 -0800
    Re: Issue on assigning address to pointers Geoff <geoff@invalid.invalid> - 2015-11-17 10:03 -0800
      Re: Issue on assigning address to pointers glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-11-17 20:31 +0000
        Re: Issue on assigning address to pointers Geoff <geoff@invalid.invalid> - 2015-11-17 12:53 -0800
    Re: Issue on assigning address to pointers Alla _ <modelling.data@gmail.com> - 2015-11-17 10:32 -0800
      Re: Issue on assigning address to pointers Richard Heathfield <rjh@cpax.org.uk> - 2015-11-17 18:45 +0000
        Re: Issue on assigning address to pointers Alla _ <modelling.data@gmail.com> - 2015-11-17 10:53 -0800
        Re: Issue on assigning address to pointers Keith Thompson <kst-u@mib.org> - 2015-11-17 15:05 -0800
          Re: Issue on assigning address to pointers Philip Lantz <prl@canterey.us> - 2015-11-19 21:16 -0800
        Re: Issue on assigning address to pointers Anand Hariharan <mailto.anand.hariharan@gmail.com> - 2015-11-17 15:47 -0800
        Re: Issue on assigning address to pointers Barry Schwarz <schwarzb@dqel.com> - 2015-11-17 15:53 -0800
          Re: Issue on assigning address to pointers Richard Heathfield <rjh@cpax.org.uk> - 2015-11-18 04:05 +0000
      Re: Issue on assigning address to pointers Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-11-17 19:41 +0000
  Re: Issue on assigning address to pointers Stephen Sprunk <stephen@sprunk.org> - 2015-11-17 12:17 -0600
    Re: Issue on assigning address to pointers Richard Heathfield <rjh@cpax.org.uk> - 2015-11-17 18:21 +0000
      Re: Issue on assigning address to pointers Geoff <geoff@invalid.invalid> - 2015-11-17 10:36 -0800
        Re: Issue on assigning address to pointers Richard Heathfield <rjh@cpax.org.uk> - 2015-11-17 18:46 +0000
          Re: Issue on assigning address to pointers Alla _ <modelling.data@gmail.com> - 2015-11-17 10:49 -0800
        Re: Issue on assigning address to pointers Alla _ <modelling.data@gmail.com> - 2015-11-17 10:47 -0800
          Re: Issue on assigning address to pointers Richard Heathfield <rjh@cpax.org.uk> - 2015-11-17 18:51 +0000
            Re: Issue on assigning address to pointers Alla _ <modelling.data@gmail.com> - 2015-11-17 10:55 -0800
          Re: Issue on assigning address to pointers Geoff <geoff@invalid.invalid> - 2015-11-17 11:59 -0800
      Re: Issue on assigning address to pointers Stephen Sprunk <stephen@sprunk.org> - 2015-11-17 12:58 -0600
        Re: Issue on assigning address to pointers Richard Heathfield <rjh@cpax.org.uk> - 2015-11-17 19:12 +0000
      Re: Issue on assigning address to pointers Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-11-17 19:33 +0000
    Re: Issue on assigning address to pointers Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2015-11-17 13:25 -0500
  Re: Issue on assigning address to pointers Richard Heathfield <rjh@cpax.org.uk> - 2015-11-17 18:31 +0000
    Re: Issue on assigning address to pointers Alla _ <modelling.data@gmail.com> - 2015-11-17 10:39 -0800
    Re: Issue on assigning address to pointers Alla _ <modelling.data@gmail.com> - 2015-11-17 10:40 -0800
      Re: Issue on assigning address to pointers Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-11-17 19:40 +0000
  Re: Issue on assigning address to pointers Geoff <geoff@invalid.invalid> - 2015-11-17 11:15 -0800
    Re: Issue on assigning address to pointers James Kuyper <jameskuyper@verizon.net> - 2015-11-17 15:32 -0500
    Re: Issue on assigning address to pointers Keith Thompson <kst-u@mib.org> - 2015-11-17 15:09 -0800
      Re: Issue on assigning address to pointers supercat@casperkitty.com - 2015-11-17 15:41 -0800
        Re: Issue on assigning address to pointers Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-11-17 21:28 -0800
          Re: Issue on assigning address to pointers supercat@casperkitty.com - 2015-11-17 23:18 -0800
      Re: Issue on assigning address to pointers Geoff <geoff@invalid.invalid> - 2015-11-17 17:18 -0800
        Re: Issue on assigning address to pointers James Kuyper <jameskuyper@verizon.net> - 2015-11-17 22:37 -0500
  Re: Issue on assigning address to pointers Lőrinczy Zsigmond <zsiga@nospam.for.me> - 2015-11-18 11:27 +0100
    Re: Issue on assigning address to pointers Keith Thompson <kst-u@mib.org> - 2015-11-18 06:13 -0800
  Re: Issue on assigning address to pointers guinness.tony@gmail.com - 2015-11-24 02:46 -0800
    Re: Issue on assigning address to pointers Keith Thompson <kst-u@mib.org> - 2015-11-24 09:21 -0800
  Re: Issue on assigning address to pointers John Bode <jfbode1029@gmail.com> - 2015-11-24 05:01 -0800
    Re: Issue on assigning address to pointers Keith Thompson <kst-u@mib.org> - 2015-11-24 09:22 -0800
  Re: Issue on assigning address to pointers John Bode <jfbode1029@gmail.com> - 2015-11-24 06:47 -0800
    Re: Issue on assigning address to pointers Alla _ <modelling.data@gmail.com> - 2015-11-25 06:44 -0800

csiph-web