Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 675404 - sci-mathematics/octave-4.4.1 - liboctave/util/lo-utils.cc: In function 'double octave_read_fp_value(std::istream&)': liboctave/util/lo-utils.cc:264:13: error: 'streampos' is not a member of 'std::ios' {aka 'std::basic_ios<char>'}
Summary: sci-mathematics/octave-4.4.1 - liboctave/util/lo-utils.cc: In function 'doubl...
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Science Mathematics related packages
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2019-01-14 14:55 UTC by Helmut Jarausch
Modified: 2019-08-25 00:38 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Helmut Jarausch 2019-01-14 14:55:23 UTC
octaveoctave-4.4.1  needs a fix

add
sed -i -e's/ios::streampos/streampos/' liboctave/util/lo-utils.cc
to src_prepare.

This fixes

liboctave/util/lo-utils.cc: In function 'double octave_read_fp_value(std::istream&)':
liboctave/util/lo-utils.cc:264:13: error: 'streampos' is not a member of 'std::ios' {aka 'std::basic_ios<char>'}
Comment 1 Tomáš Mózes 2019-01-14 15:00:16 UTC
Are you hitting an error during compilation? Please attach the full build log and the output of emerge --info.
Comment 2 Helmut Jarausch 2019-04-03 08:36:37 UTC
(In reply to Tomáš Mózes from comment #1)
> Are you hitting an error during compilation? Please attach the full build
> log and the output of emerge --info.

I get liboctave/util/lo-utils.cc: In function 'double octave_read_fp_value(std::istream&)':
liboctave/util/lo-utils.cc:264:13: error: 'streampos' is not a member of 'std::ios' {aka 'std::basic_ios<char>'}
   std::ios::streampos pos = is.tellg ();


This error is only flagged if one uses  -std=c++17 as I do.
You can try to compile
#include <fstream>

int main() {
  std::ifstream is("T.c");
//  std::streampos pos = is.tellg ();  //OK
  std::ios::streampos pos = is.tellg ();  // NOT OK
}

with g++ -c -std=c++17 

According to http://www.cplusplus.com/reference/ios/streampos/
streampos is now a member of the namespace std but not of std::ios any more.

It is safe to use std::streampos even if -std=c++14.
Comment 3 Fabio Rossi 2019-04-03 09:28:41 UTC
Thanks for investigating about the root cause of the problem. 

IMHO the problem is in your CXXFLAGS, why are you specifying globally -std=c++17? Usually if a package needs particular flags like that than they are specified in the package build configuration system.

Until the minimum required c++ standard version used by gcc is 2017 I am not sure if it makes sense to add a specific patch to portage, currently gcc-8 defines

$ g++ -dM -E -x c++  /dev/null | grep -F __cplusplus
#define __cplusplus 201402L

The package maintainer should choose about fixing the issue or not.

Anyway I have sent upstream a patch as in the code they are already using std::streampos everywhere else, here is reference: https://savannah.gnu.org/patch/index.php?9782
Comment 4 Benda Xu gentoo-dev 2019-08-25 00:38:28 UTC
Thank you Helmut and Fabio!