Re: returning address of stack variable



Richard Heathfield wrote:

pete said:

websnarf@xxxxxxxxx wrote:

This is probably true in exactly the same way that
Keith
thinks that variables are not part of the C programming language
(i.e., not at all
except that maybe you can't grep for it in the standard.)

Inapt analogy: You can grep on "variables" in the standard.

You won't get any hits, though.
Well, I didn't, in the C89 draft. Searching
for the singular, "variable", gave me 23 hits,
most of which were to do
with variable argument lists. But I did find these:

"the ``integral promotions'' require that the abstract machine promote
the value of each variable to int size and then add the two int s and
truncate the sum." (referring to a couple of char objects) - 2.1,
non-normative example

"Therefore, for full portability the variable
c should be declared as int."
- 3.3.16.1, non-normative example

"The following pair of declarations demonstrates the difference
between a ``variable pointer to a constant value'' and a ``constant
pointer to a variable value.''" - 3.5.4.1, non-normative example

"...assigning a value to a static storage
duration variable of type volatile
sig_atomic_t" - 4.7.1.1 - normative text.

"an enumeration variable that has the same type" - A.5, non-normative
appendix

I think the normative text of 4.7.1.1
shows that "variable" is indeed a C
concept. It's a shame, in a way, since it's such a woolly term.
Did this
usage in 4.7.1.1 survive into the final C89 standard?

Yes, they all survived.
C99 has the word "variables".

--
pete
.



Relevant Pages

  • Re: returning address of stack variable
    ... You can grep on "variables" in the standard. ... the value of each variable to int size and then add the two int s and ... "The following pair of declarations demonstrates the difference ... between a ``variable pointer to a constant value'' and a ``constant ...
    (comp.lang.c)
  • Re: Fast sincos routine
    ... > The sign bit in an int, is just the sign bit in an int. ... The standard specifies that that sign bit is 0. ... Pete provide us with a real-life example of a useful ... CBFalconer show us the errata for the standard that disallows this case ...
    (comp.lang.c)
  • Re: ASSIGNMENT
    ... pete wrote: ... int total ... Unfortunately this program does not conform to the C standard. ...
    (comp.lang.c)
  • Re: ---What this mean
    ... >> characters have positive values. ... > argument is an int, the value of which shall be ... pete> int ato_i ... Similar to invoking the standard is* functions. ...
    (comp.lang.c)
  • Re: Signed?
    ... Pete C. wrote: ... >> According to the Standard, are the above signed or unsigned? ... > int, short and long are, char is implementation defined. ... I mean, int, short and long are signed. ...
    (comp.lang.cpp)

Loading