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


Groups > comp.lang.c > #112220

Re: isspace() executes without ctype header?

Path csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From Keith Thompson <kst-u@mib.org>
Newsgroups comp.lang.c
Subject Re: isspace() executes without ctype header?
Date Wed, 14 Jun 2017 13:06:33 -0700
Organization None to speak of
Lines 31
Message-ID <ln7f0ecp12.fsf@kst-u.example.com> (permalink)
References <ohq29k$892$1@dont-email.me> <kfna85b8g3i.fsf@x-alumni2.alumni.caltech.edu> <ohq8oe$mi3$1@dont-email.me> <kfno9tq7fpd.fsf@x-alumni2.alumni.caltech.edu> <ivd0B.96368$3k.53796@fx03.am4> <ln4lviecup.fsf@kst-u.example.com> <USd0B.212390$kd6.181170@fx33.am4> <65b55827-2e50-474e-8b47-a5d70747b53b@googlegroups.com> <lnk24ecrxr.fsf@kst-u.example.com> <48dce15f-c200-4b79-9f3e-3007391a134c@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Injection-Info mx02.eternal-september.org; posting-host="96bbf95725af2559ab0735ee54475e20"; logging-data="3357"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Is35z3VtqLYwglzEpPMM4"
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)
Cancel-Lock sha1:9U3vFx0uL/cdTIFIk5hSOTGCwSY= sha1:7QaI3B6qPs7tbm2IFnq5lTMhZHo=
Xref csiph.com comp.lang.c:112220

Show key headers only | View raw


supercat@casperkitty.com writes:
> On Wednesday, June 14, 2017 at 2:03:52 PM UTC-5, Keith Thompson wrote:
>> Both cman74.pdf and cman.pdf (from 1975, I think) says that char
>> arguments are promoted to int, and float arguments to double.
>> (char, int, float, and double were the only numeric types.)
>> No other conversions are specified.
>
> The layout of passed arguments was effectively documented by the sample
> printf function, and there were no aliasing rules.  I will grant that it
> is unclear whether implementations would have been expected to ensure that
> a memcpy-style function could be invoked without requiring a caller-side
> cast, but I don't recall anything in that manual that would suggest that
> such a cast would be needed.

The sample printf implementation in cman.pdf accepts arguments of types
int, double, and char* (the latter points to a string for "%s").  The
code that handles the arguments increments a pointer to int for int
arguments, a pointer to double for double arguments, and a pointer to
char* for char* arguments.  It certainly assumes that arguments are
allocated sequentially and in order, but I see no assumptions about the
representations of different pointer types.  And it clearly says, "It
should be evident, though, that such techniques are implementation
dependent."

[...]

-- 
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

isspace() executes without ctype header? DFS <nospam@dfs.com> - 2017-06-13 21:13 -0400
  Re: isspace() executes without ctype header? Ian Collins <ian-news@hotmail.com> - 2017-06-14 13:20 +1200
    Re: isspace() executes without ctype header? DFS <nospam@dfs.com> - 2017-06-13 21:33 -0400
      Re: isspace() executes without ctype header? Ian Collins <ian-news@hotmail.com> - 2017-06-14 13:35 +1200
        Re: isspace() executes without ctype header? DFS <nospam@dfs.com> - 2017-06-13 22:31 -0400
          Re: isspace() executes without ctype header? Ian Collins <ian-news@hotmail.com> - 2017-06-14 14:40 +1200
  Re: isspace() executes without ctype header? Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2017-06-13 21:49 -0400
  Re: isspace() executes without ctype header? Tim Rentsch <txr@alumni.caltech.edu> - 2017-06-13 19:20 -0700
    Re: isspace() executes without ctype header? DFS <nospam@dfs.com> - 2017-06-13 23:04 -0400
      Re: isspace() executes without ctype header? asetofsymbols@gmail.com - 2017-06-13 23:07 -0700
      Re: isspace() executes without ctype header? Tim Rentsch <txr@alumni.caltech.edu> - 2017-06-14 08:26 -0700
        Re: isspace() executes without ctype header? bartc <bc@freeuk.com> - 2017-06-14 17:29 +0100
          Re: isspace() executes without ctype header? Keith Thompson <kst-u@mib.org> - 2017-06-14 09:46 -0700
            Re: isspace() executes without ctype header? bartc <bc@freeuk.com> - 2017-06-14 17:54 +0100
              Re: isspace() executes without ctype header? Keith Thompson <kst-u@mib.org> - 2017-06-14 10:17 -0700
              Re: isspace() executes without ctype header? supercat@casperkitty.com - 2017-06-14 10:48 -0700
                Re: isspace() executes without ctype header? Keith Thompson <kst-u@mib.org> - 2017-06-14 12:03 -0700
                Re: isspace() executes without ctype header? supercat@casperkitty.com - 2017-06-14 12:48 -0700
                Re: isspace() executes without ctype header? Keith Thompson <kst-u@mib.org> - 2017-06-14 13:06 -0700
            Re: isspace() executes without ctype header? Tim Rentsch <txr@alumni.caltech.edu> - 2017-06-16 23:14 -0700
  Re: isspace() executes without ctype header? bartc <bc@freeuk.com> - 2017-06-14 11:18 +0100
    Re: isspace() executes without ctype header? Keith Thompson <kst-u@mib.org> - 2017-06-14 09:35 -0700
      Re: isspace() executes without ctype header? bartc <bc@freeuk.com> - 2017-06-14 17:47 +0100
        Re: isspace() executes without ctype header? supercat@casperkitty.com - 2017-06-14 10:19 -0700
          Re: isspace() executes without ctype header? Keith Thompson <kst-u@mib.org> - 2017-06-14 10:29 -0700
        Re: isspace() executes without ctype header? Keith Thompson <kst-u@mib.org> - 2017-06-14 10:21 -0700
          Re: isspace() executes without ctype header? bartc <bc@freeuk.com> - 2017-06-14 19:12 +0100
            Re: isspace() executes without ctype header? Keith Thompson <kst-u@mib.org> - 2017-06-14 12:12 -0700
            Re: isspace() executes without ctype header? joel.rees@gmail.com - 2017-06-16 17:56 -0700
              Re: isspace() executes without ctype header? supercat@casperkitty.com - 2017-06-17 10:20 -0700
                Re: isspace() executes without ctype header? Robert Wessel <robertwessel2@yahoo.com> - 2017-06-18 00:25 -0500
                Re: isspace() executes without ctype header? supercat@casperkitty.com - 2017-06-19 09:01 -0700
                Re: isspace() executes without ctype header? Robert Wessel <robertwessel2@yahoo.com> - 2017-06-19 21:59 -0500

csiph-web