Re: Suffix allowed on expressions?



Keith Thompson wrote:
CBFalconer <cbfalconer@xxxxxxxxx> writes:
dspfun wrote:

... snip ...

Could you give a pointer to where in the standard it says that an
integer (constant) can be typecasted to a pointer and the result
is implementation dependent?

You can answer this sort of question more easily yourself, with a
text version of the C standard and grep. grep is available
everywhere. For the text version I suggest N869_txt.bz2, which is
a bzip2 compressed version of N869, and is available at:

<http://cbfalconer.home.att.net/download/>

n1256.pdf, available at
<http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf>,
is more current. It's PDF rather than plain text, which may or may
not be a problem.

I'm not convinced that a simple grep would be useful in this case.
For example, the word "typecast" appears nowhere in the standard.
What would you grep for?

For example, I just entered:

grep -n cast \stds\n869.txt | less

and got a set of roughly 60 lines. This took all of 2 seconds. It
shouldn't take much to hide that output and just save the line
numbers, which can then be used to illuminate all the areas of
interest.

--
Chuck F (cbfalconer at maineline dot net)
<http://cbfalconer.home.att.net>
Try the download section.



--
Posted via a free Usenet account from http://www.teranews.com

.



Relevant Pages

  • Re: Suffix allowed on expressions?
    ... integer can be typecasted to a pointer and the result ... text version of the C standard and grep. ... the word "typecast" appears nowhere in the standard. ...
    (comp.lang.c)
  • Re: Suffix allowed on expressions?
    ... snip ... ... integer can be typecasted to a pointer and the result ... text version of the C standard and grep. ...
    (comp.lang.c)
  • Re: Suffix allowed on expressions?
    ... there is no way in standard C to access a specific memory ... integer to a pointer in order to access an absolute location. ... C does permit an integer to be typecast to a pointer, ... the result is implementation dependant, ...
    (comp.lang.c)
  • Re: Suffix allowed on expressions?
    ... I'm not convinced that a simple grep would be useful in this case. ... the word "typecast" appears nowhere in the standard. ... CLC FAQ ...
    (comp.lang.c)
  • Re: A C++ Whishlist
    ... In the vast majority of member functions the first thing you will do ... If I feel it needs an extra check because it won't crash cleanly I may ... >> unless you also check the this pointer you aren't checking every ... The standard does not say "the this pointer cannot be NULL". ...
    (comp.lang.cpp)