bugGNU Octave - Bugs: bug #51638, mach-info.cc uses unguaranteed...

 
 

bug #51638: mach-info.cc uses unguaranteed behavior to determine endian-ness

Submitter:  Rik <rik5>
Submitted:  Tue 01 Aug 2017 06:21:02 PM UTC
   
 
Category:  Configuration and Build System Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Other
Status:  Fixed Assigned to:  jwe
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 01 Aug 2017 10:34:36 PM UTC, comment #2: 

Pulled, built, and verified that the new file was compiled with a C compiler.  Closing report.

Rik <rik5>
Group administrator
Tue 01 Aug 2017 07:40:18 PM UTC, comment #1: 
John W. Eaton <jwe>
Group administrator
Tue 01 Aug 2017 06:21:02 PM UTC, original submission:  

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

Rik <rik5>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Updated the item)
  • -email is unavailable- added by rik5 (Submitted the item)
  • -email is unavailable- added by rik5
  • -email is unavailable- added by rik5
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-08-01 rik5 StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2017-08-01 jwe StatusConfirmed Ready For Test
    2017-08-01 jwe Assigned toNone jwe
    2017-08-01 rik5 Carbon-Copy- Added jwe
        Carbon-Copy- Added dasergatskov

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code