[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #51638] mach-info.cc uses unguaranteed behavio
From: |
Rik |
Subject: |
[Octave-bug-tracker] [bug #51638] mach-info.cc uses unguaranteed behavior to determine endian-ness |
Date: |
Tue, 1 Aug 2017 14:21:03 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0 |
URL:
<http://savannah.gnu.org/bugs/?51638>
Summary: mach-info.cc uses unguaranteed behavior to determine
endian-ness
Project: GNU Octave
Submitted by: rik5
Submitted on: Tue 01 Aug 2017 11:21:02 AM PDT
Category: Configuration and Build System
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Other
Status: Confirmed
Assigned to: None
Originator Name:
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: dev
Operating System: Any
_______________________________________________________
Details:
The file liboctave/system/mach-info.cc writes a value into one union member,
and then reads from a second union member. This behavior is
implementation-dependent in C++ (see
http://en.cppreference.com/w/cpp/language/union).
Either mach-info.cc needs to be re-coded to avoid this construct, or the file
should be downgraded to a straight C language file where the code usage in
question is guaranteed.
For a much longer article on determining endian-ness in C++, see
http://dbp-consulting.com/tutorials/StrictAliasing.html
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?51638>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #51638] mach-info.cc uses unguaranteed behavior to determine endian-ness,
Rik <=