bugGNU Octave - Bugs: bug #45411, ...

 
 

bug #45411: octave_int<T>::octave_int(char) is invalid on Sparc Solaris

Submitted by:  Tatsuro MATSUOKA <tmacchant>
Submitted on:  Fri 26 Jun 2015 02:53:02 AM UTC  
 
Category: LibrariesSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Build Failure
Status: FixedAssigned to: None
Originator Name: Tatsuro MATUOKAOpen/Closed: Closed
Release: 4.0.0Operating System: Solaris/SunOS

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

(Jump to the original submission Jump to the original submission)

Tue 09 Feb 2016 07:57:52 PM UTC, comment #11:

Done on stable, apologies to all for the delay.

http://hg.savannah.gnu.org/hgweb/octave/rev/b48d65c5df5b

I can't remember if gnulib has been updated on the stable branch, but this change along with http://hg.savannah.gnu.org/hgweb/octave/rev/375cea8d4135 and an updated gnulib should allow the upcoming 4.0.1 to build on Solaris.

Mike Miller <mtmiller>
Project Administrator
Thu 04 Feb 2016 10:32:49 PM UTC, comment #10:

Seems fine to me.

John W. Eaton <jwe>
Project Administrator
Thu 04 Feb 2016 09:58:48 PM UTC, comment #9:

Any objections to the following change on the stable branch? I have tested this patch against 4.0.0 on Solaris (where the patch fixes compilation error), on Linux (where the patch has no effect), and on Linux with a modified stdint.h (where the patch fixes the same compilation error as on Solaris). It would be nice to get this fixed in 4.0.1.

(file #36248)

Mike Miller <mtmiller>
Project Administrator
Sat 08 Aug 2015 03:28:48 PM UTC, comment #8:

Attaching a patch that allows Octave 4.0.0 to build completely on Solaris. The first hunk of the patch is a change that's already been made in gnulib but not merged into Octave yet (http://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=d6176702c3ffb6c56e6620397470e1b3bd540b10). The second two can be improved by adding configure tests to detect whether the system allows char to overload int8_t.

(file #34597)

Mike Miller <mtmiller>
Project Administrator
Mon 03 Aug 2015 05:10:33 PM UTC, comment #7:

I am working with the original reporter of this problem (Tatsuro, no more need to copy messages back and forth, but thanks for your help so far!) I can confirm that this function overload is invalid because of what I suspected, that on Sparc Solaris the int8_t is defined to be "char" instead of "signed char". On Linux, both are signed, but they are distinct types in the C++ language so they can be safely overloaded.

The quickest way I can see around this is to not compile that particular overload.

This particular overload was added to fix bug #42054 (see changeset http://hg.savannah.gnu.org/hgweb/octave/rev/37c300acfcfd). Is there a different way to solve the original problem without this problematic overload?

Updating bug meta info.

Mike Miller <mtmiller>
Project Administrator
Sun 26 Jul 2015 02:38:31 AM UTC, comment #6:

The signed vs. unsigned 8-bit type sounds about right. Can't think of any simple approach because there appears to be a lot going on with regard to the definition. In particular, these lines:

mess around with the definitions of int8_t and uint8_t. Octave seems to be assuming int8_t is signed, so if int8_t is undefined and some how redefined with a "signed" qualifier it might be fine in terms of Octave's mathematical treatment of related variable types.

Dan Sebald <sebald>
Sat 11 Jul 2015 11:30:22 PM UTC, comment #5:

This error seems to be because Solaris system headers define int8_t as "typedef char int8_t", while Linux uses "typedef signed char int8_t". This means in Linux we have distinct overloads for octave_int<int8_t> but in Solaris they are not distinct.

Probably needs a new configure test and a conditional compile to get around this, anyone other ideas?

Mike Miller <mtmiller>
Project Administrator
Sat 11 Jul 2015 07:42:11 AM UTC, comment #4:

Other person (handle name ccj4467) gives us error message for octave-4.0.0 on the octave ML.

http://octave.1599824.n4.nabble.com/Compile-error-at-compiling-liboctave-array-Array-b-cc-due-to-cannot-be-overloaded-octave-int-char-c-tp4671122p4671544.html

seems to be the same as those on 3.8.2.

Tatsuro MATSUOKA <tmacchant>
Fri 26 Jun 2015 09:15:10 PM UTC, comment #3:

Michele

Could you give us the screen output for 4.0.0 during gmake?

Tatsuro MATSUOKA <tmacchant>
Fri 26 Jun 2015 06:12:43 PM UTC, comment #2:

The original mailing list thread said and comment #0 below both said that building both 3.8.2 and 4.0.0 resulted in the same error, can't confirm but retagging.

Mike Miller <mtmiller>
Project Administrator
Fri 26 Jun 2015 03:41:11 PM UTC, comment #1:

The same error may result, but can the original reporter verify this with the 4.0.0 code? The 3.8.2 version of Octave is unsupported and I don't want to bother with something that may have been fixed, or where the line numbers of the error messages could be totally different.

Rik <rik5>
Project Administrator
Fri 26 Jun 2015 02:53:02 AM UTC, original submission:

This is originally discussed at
http://octave.1599824.n4.nabble.com/Compile-error-at-compiling-liboctave-array-Array-b-cc-due-to-quot-cannot-be-overloaded-octave-int-ch-td4671122.html

by Michele31415.

*********************
The environments etcs.
Sparc Solaris , gcc-4.9.2
Octave 3.8.2 (4.0.0 may give the same error)

Compiling source file: liboctave/array/Array-b.cc
Place error occurred: liboctave/util/oct-inttypes.h

Error message:

Daniel Sebald's assumption
To me, that sounds like attempting to convert 8-bit integer
behavior to 16-bit integer so that the << operators output numbers.
Somehow this sort of trick (for lack of word) isn't compiling
correctly on SPARC.

Mike Muller
Yes I think so. Unfortunately this also needs someone with access
to a SPARC Solaris system with GNU tools to reproduce and provide a
fix. Notably we don't see this error when building Octave on a
SPARC with Debian GNU/Linux [1].

[1] https://buildd.debian.org/status/logs.php?pkg=octave&ver=3.8.2-4&arch=sparc

Source of oct-inttypes.h of octave-3.8.2 is attached.

Short log ans short source on this matter

Full log for errors (and warnings)

Tatsuro MATSUOKA <tmacchant>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #36248:  oct-sol.diff added by mtmiller (2KiB - text/x-diff)
file #34321:  oct-inttypes.h added by tmacchant (34KiB - text/plain)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by sebald (Posted a comment)
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by tmacchant (Submitted the item)
  • -unavailable- added by tmacchant
  • -unavailable- added by tmacchant
  • -unavailable- added by tmacchant
  • -unavailable- added by tmacchant
  • -unavailable- added by tmacchant
  •  

    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 18 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 09 Feb 2016 07:57:52 PM UTCmtmillerStatusConfirmed=>Fixed
      Open/ClosedOpen=>Closed
    Thu 04 Feb 2016 09:58:47 PM UTCmtmillerAttached File-=>Added oct-sol.diff, #36248
    Sat 08 Aug 2015 03:28:48 PM UTCmtmillerAttached File-=>Added octave-4.0.0-solaris-gcc49.patch, #34597
    Mon 03 Aug 2015 05:10:33 PM UTCmtmillerCategoryConfiguration and Build System=>Libraries
      StatusNeed Info=>Confirmed
      Summarycast fail at liboctave/util/oct-inttypes.h on Sparc Solaris=>octave_int::octave_int(char) is invalid on Sparc Solaris
    Sat 11 Jul 2015 06:51:54 PM UTCrik5Carbon-CopyRemoved rik =>-
    Sat 11 Jul 2015 06:51:42 PM UTCrik5Carbon-CopyRemoved 72865=>-
    Fri 26 Jun 2015 06:12:43 PM UTCmtmillerStatusNone=>Need Info
      Release3.8.2=>4.0.0
    Fri 26 Jun 2015 02:53:02 AM UTCtmacchantAttached File-=>Added oct-inttypes.h, #34321
      Carbon-Copy-=>Added -unavailable-
      Carbon-Copy-=>Added daniel j sebald
      Carbon-Copy-=>Added rik
      Carbon-Copy-=>Added jwe
      Carbon-Copy-=>Added jordi
      Carbon-Copy-=>Added michele31415

    Back to the top


    Powered by Savane 3.1-cleanup1