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


Groups > comp.lang.c > #41369

Re: Few questions about casting away const.

From Daniel <daniel@inventati.org>
Newsgroups comp.lang.c
Subject Re: Few questions about casting away const.
Date 2014-03-05 06:11 +0000
Organization Aioe.org NNTP Server
Message-ID <lf6f6d$t9e$1@speranza.aioe.org> (permalink)
References <lf4cq3$mie$1@speranza.aioe.org> <53163527.2090509@verizon.net> <lf68bs$l2s$1@speranza.aioe.org> <0.775bbd858311484cf33f.20140305043538GMT.87txbd9s9x.fsf@bsb.me.uk>

Show all headers | View raw


Ben <ben.usenet@bsb.me.uk> Bacarisse wrote:
> It's a good idea to keep attribution lines.

Sure. I'm fairly new to newsgroups so I'm still getting the hang of 
quoting and what-not.

> Re my remark elsewhere, you can fix this by using va_arg(ap, void *).
> There is a special dispensation for this case in 7.16.1.1 p2.  I was not
> paying attention when I said it was OK.

Right. I've been reading the source code of the OpenBSD libc and I 
noticed that they use 'char *' for this purpose (and that may have skewed 
my understanding), but I suppose they're able to rely on implementation 
details given the level they're working at.

With that said, I'm glad va_arg offers a portable way to match a 'const 
char *' and a 'char *' through the use of the 'void *' argument. 
Considering the language in 7.16.1.1p2, would it be reasonable to infer 
that 'const unsigned char *' and 'const signed char *' may be converted 
to 'unsigned char *' and 'signed char *', respectively, using the same 
method?

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


Thread

Few questions about casting away const. Daniel <daniel@inventati.org> - 2014-03-04 11:18 +0000
  Re: Few questions about casting away const. Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-03-04 12:39 +0000
  Re: Few questions about casting away const. Kaz Kylheku <kaz@kylheku.com> - 2014-03-04 17:05 +0000
  Re: Few questions about casting away const. Keith Thompson <kst-u@mib.org> - 2014-03-04 10:16 -0800
    Re: Few questions about casting away const. Daniel <daniel@inventati.org> - 2014-03-05 03:45 +0000
      Re: Few questions about casting away const. Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-03-05 04:20 +0000
  Re: Few questions about casting away const. James Kuyper <jameskuyper@verizon.net> - 2014-03-04 15:18 -0500
    Re: Few questions about casting away const. Daniel <daniel@inventati.org> - 2014-03-05 04:14 +0000
      Re: Few questions about casting away const. Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-03-05 04:35 +0000
        Re: Few questions about casting away const. Daniel <daniel@inventati.org> - 2014-03-05 06:11 +0000
          Re: Few questions about casting away const. Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-03-05 12:14 +0000
            Re: Few questions about casting away const. Daniel Harrison <daniel@inventati.org> - 2014-03-07 04:31 +0000
              Re: Few questions about casting away const. Barry Schwarz <schwarzb@dqel.com> - 2014-03-06 21:23 -0800
                Re: Few questions about casting away const. Kaz Kylheku <kaz@kylheku.com> - 2014-03-07 05:59 +0000
              Re: Few questions about casting away const. James Kuyper <jameskuyper@verizon.net> - 2014-03-07 07:18 -0500
              Re: Few questions about casting away const. Tim Rentsch <txr@alumni.caltech.edu> - 2014-03-10 00:30 -0700
                Re: Few questions about casting away const. Keith Thompson <kst-u@mib.org> - 2014-03-10 09:00 -0700
                Re: Few questions about casting away const. Tim Rentsch <txr@alumni.caltech.edu> - 2014-03-10 11:13 -0700
                Re: Few questions about casting away const. Keith Thompson <kst-u@mib.org> - 2014-03-10 12:10 -0700
                Re: Few questions about casting away const. Kaz Kylheku <kaz@kylheku.com> - 2014-03-11 07:38 +0000
                Re: Few questions about casting away const. Tim Rentsch <txr@alumni.caltech.edu> - 2014-03-29 09:02 -0700
          Re: Few questions about casting away const. Tim Rentsch <txr@alumni.caltech.edu> - 2014-03-10 02:29 -0700
            Re: Few questions about casting away const. Keith Thompson <kst-u@mib.org> - 2014-03-10 10:52 -0700
              Re: Few questions about casting away const. Tim Rentsch <txr@alumni.caltech.edu> - 2014-03-29 08:50 -0700

csiph-web