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


Groups > comp.lang.c++ > #6982

Re: Strict aliasing and buffer handling

From Kai-Uwe Bux <jkherciueh@gmx.net>
Newsgroups comp.lang.c++
Subject Re: Strict aliasing and buffer handling
Followup-To comp.lang.c++
Date 2011-06-20 23:38 +0200
Organization University of Bielefeld
Message-ID <itoekf$9n3$1@hoshi.visyn.net> (permalink)
References (3 earlier) <UPidnUow18I4BmLQnZ2dnUVZ7oednZ2d@giganews.com> <59682659-868a-4498-b5bc-ef53f6a74105@k6g2000yqc.googlegroups.com> <ito9h7$6jr$1@dont-email.me> <5fa0718f-c308-450c-ac3b-b71c0638dc1e@r14g2000yqr.googlegroups.com> <itodld$67u$1@dont-email.me>

Followups directed to: comp.lang.c++

Show all headers | View raw


Alf P. Steinbach /Usenet wrote:

> * Francois Duranleau, on 20.06.2011 22:29:
>> On Jun 20, 4:16 pm, "Alf P. Steinbach /Usenet"<alf.p.steinbach
>> +use...@gmail.com>  wrote:
>>>
>>> Strict aliasing is a g++ thing, not a standard C++ thing: the standard
>>> is The Wrong Place to look for info about strict aliasing, it's not
>>> there.
>>
>> Quoting 3.10-15 from the C++ standard (2003):
>>
>> "If a program attempts to access the stored value of an object through
>> an lvalue of other than one of the following
>> types the behavior is undefined):
>> ? the dynamic type of the object,
>> ? a cv-qualified version of the dynamic type of the object,
>> ? a type that is the signed or unsigned type corresponding to the
>> dynamic type of the object,
>> ? a type that is the signed or unsigned type corresponding to a cv-
>> qualified version of the dynamic type of the object,
>> ? an aggregate or union type that includes one of the aforementioned
>> types among its members (including, recursively, a member of a
>> subaggregate or contained union),
>> ? a type that is a (possibly cv-qualified) base class type of the
>> dynamic type of the object,
>> ? a char or unsigned char type."
>>
>> So what I am reading here?
> 
> A flawed attempt at enumerating the ways, which attempt was/is presumably
> the perceived rationale for g++ "strict aliasing".

What is the flaw?

I don't think the flaw is obvious (it isn't to me). As evidence (not that it 
isn't flawed, but that's it is not _obviously_ flawed) I would offer that an 
adapted version of the list made it into n3291 as 3.10/10. So, it appears, 
the committee did not see a flaw; or is there a core issue about this that I 
am unaware of? or is the flaw just fixed by passing to glvalues etc.?


Best,

Kai-Uwe Bux

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


Thread

Strict aliasing and buffer handling Francois Duranleau <xiao.bai.xiong@gmail.com> - 2011-06-20 09:59 -0700
  Re: Strict aliasing and buffer handling "Paul" <pchristor@yahoo.co.uk> - 2011-06-20 19:39 +0100
    Re: Strict aliasing and buffer handling Francois Duranleau <xiao.bai.xiong@gmail.com> - 2011-06-20 11:56 -0700
      Re: Strict aliasing and buffer handling Leigh Johnston <leigh@i42.co.uk> - 2011-06-20 20:12 +0100
        Re: Strict aliasing and buffer handling Francois Duranleau <xiao.bai.xiong@gmail.com> - 2011-06-20 12:39 -0700
          Re: Strict aliasing and buffer handling Leigh Johnston <leigh@i42.co.uk> - 2011-06-20 20:49 +0100
            Re: Strict aliasing and buffer handling "Paul" <pchristor@yahoo.co.uk> - 2011-06-20 21:12 +0100
              Re: Strict aliasing and buffer handling Leigh Johnston <leigh@i42.co.uk> - 2011-06-20 21:20 +0100
                Re: Strict aliasing and buffer handling "Paul" <pchristor@yahoo.co.uk> - 2011-06-21 10:35 +0100
                Re: Strict aliasing and buffer handling Leigh Johnston <leigh@i42.co.uk> - 2011-06-21 12:35 +0100
                Re: Strict aliasing and buffer handling "Paul" <pchristor@yahoo.co.uk> - 2011-06-21 12:37 +0100
          Re: Strict aliasing and buffer handling "Alf P. Steinbach /Usenet" <alf.p.steinbach+usenet@gmail.com> - 2011-06-20 22:16 +0200
            Re: Strict aliasing and buffer handling Francois Duranleau <xiao.bai.xiong@gmail.com> - 2011-06-20 13:29 -0700
              Re: Strict aliasing and buffer handling "Alf P. Steinbach /Usenet" <alf.p.steinbach+usenet@gmail.com> - 2011-06-20 23:27 +0200
                Re: Strict aliasing and buffer handling Joshua Maurice <joshuamaurice@gmail.com> - 2011-06-20 14:37 -0700
                Re: Strict aliasing and buffer handling "Alf P. Steinbach /Usenet" <alf.p.steinbach+usenet@gmail.com> - 2011-06-21 00:31 +0200
                Re: Strict aliasing and buffer handling Joshua Maurice <joshuamaurice@gmail.com> - 2011-06-20 19:37 -0700
                Re: Strict aliasing and buffer handling Kai-Uwe Bux <jkherciueh@gmx.net> - 2011-06-20 23:38 +0200
                Re: Strict aliasing and buffer handling "Alf P. Steinbach /Usenet" <alf.p.steinbach+usenet@gmail.com> - 2011-06-21 00:46 +0200
                Re: Strict aliasing and buffer handling Francois Duranleau <xiao.bai.xiong@gmail.com> - 2011-06-21 05:03 -0700
                Re: Strict aliasing and buffer handling "Alf P. Steinbach /Usenet" <alf.p.steinbach+usenet@gmail.com> - 2011-06-21 16:19 +0200
                Re: Strict aliasing and buffer handling Francois Duranleau <xiao.bai.xiong@gmail.com> - 2011-06-21 09:08 -0700
                Re: Strict aliasing and buffer handling "Alf P. Steinbach /Usenet" <alf.p.steinbach+usenet@gmail.com> - 2011-06-22 01:43 +0200
  Re: Strict aliasing and buffer handling Joshua Maurice <joshuamaurice@gmail.com> - 2011-06-20 14:49 -0700
  Re: Strict aliasing and buffer handling "io_x" <a@b.c.invalid> - 2011-06-21 09:12 +0200
    Re: Strict aliasing and buffer handling Ian Collins <ian-news@hotmail.com> - 2011-06-21 20:14 +1200

csiph-web