Groups | Search | Server Info | Keyboard shortcuts | Login | Register


Groups > comp.compilers > #2756

Re: Union C++ standard

From Derek Jones <derek@NOSPAM-knosof.co.uk>
Newsgroups comp.compilers
Subject Re: Union C++ standard
Date 2021-11-28 12:51 +0000
Organization Compilers Central
Message-ID <21-11-009@comp.compilers> (permalink)
References <21-11-004@comp.compilers> <21-11-008@comp.compilers>

Show all headers | View raw


David,

> In C, type-punning via unions is allowed (i.e., fully defined behaviour

That is not true.  Writing into one member and then reading from
another member is undefined behavior.

There is a special dispensation for what is known as a
common initial sequence:
sentence 1029
http://c0x.shape-of-code.com/6.5.2.3.html

> in the standards), but not in C++ where the language is expected to
> enforce higher-level aspects of the data.

This is a meaningless statement.

Back to comp.compilers | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Union C++ standard Hans-Peter Diettrich <DrDiettrich1@netscape.net> - 2021-11-25 11:11 +0100
  Re: Union C++ standard Kaz Kylheku <480-992-1380@kylheku.com> - 2021-11-26 18:06 +0000
  Re: Union C++ standard gah4 <gah4@u.washington.edu> - 2021-11-26 12:16 -0800
  Re: Union C++ standard David Brown <david.brown@hesbynett.no> - 2021-11-27 16:59 +0100
    Re: Union C++ standard Derek Jones <derek@NOSPAM-knosof.co.uk> - 2021-11-28 12:51 +0000
      Re: Union C++ standard David Brown <david.brown@hesbynett.no> - 2021-11-28 19:00 +0100
        Re: Union C++ standard Derek Jones <derek@NOSPAM-knosof.co.uk> - 2021-11-29 00:09 +0000
          Re: Union C++ standard David Brown <david.brown@hesbynett.no> - 2021-11-29 21:00 +0100
            Re: Union C++ standard Derek Jones <derek@NOSPAM-knosof.co.uk> - 2021-11-30 00:46 +0000
              Re: Union C++ standard George Neuner <gneuner2@comcast.net> - 2021-11-30 17:18 -0500
                Re: Union C++ standard terminology Derek Jones <derek@knosof.co.uk> - 2021-12-01 13:35 +0000
              Re: Union C++ standard David Brown <david.brown@hesbynett.no> - 2021-11-30 23:24 +0100
        Re: Union C++ standard Kaz Kylheku <480-992-1380@kylheku.com> - 2021-11-29 16:39 +0000
          Re: Union C++ standard Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2021-11-29 14:32 -0800

csiph-web