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

 
 

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

Submitted by:  Rik <rik5>
Submitted on:  Tue 01 Aug 2017 06:21:02 PM UTC  
 
Category: Configuration and Build SystemSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Other
Status: FixedAssigned to: John W. Eaton <jwe>
Originator Name: Open/Closed: Closed
Release: devOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project Administrator
Tue 01 Aug 2017 07:40:18 PM UTC, comment #1:

I pushed the following changeset:

http://hg.savannah.gnu.org/hgweb/octave/rev/1a08d0ac510f

John W. Eaton <jwe>
Project AdministratorIn charge of this item.
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>
Project Administrator

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 01 Aug 2017 10:34:36 PM UTCrik5StatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
    Tue 01 Aug 2017 07:40:18 PM UTCjweStatusConfirmed=>Ready For Test
    Tue 01 Aug 2017 06:32:56 PM UTCjweAssigned toNone=>jwe
    Tue 01 Aug 2017 06:21:02 PM UTCrik5Carbon-Copy-=>Added jwe
      Carbon-Copy-=>Added dasergatskov

    Back to the top


    Powered by Savane 3.1-cleanup1