Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

g++48: functions.cpp:224:34: error: 'round' is not a member of 'std' #1457

Closed
saper opened this issue Aug 19, 2015 · 13 comments
Closed

g++48: functions.cpp:224:34: error: 'round' is not a member of 'std' #1457

saper opened this issue Aug 19, 2015 · 13 comments

Comments

@saper
Copy link
Member

saper commented Aug 19, 2015

/usr/local/lib/gcc48 -MT functions.lo -MD -MP -MF .deps/functions.Tpo -c functions.cpp  -fPIC -DPIC -o .libs/functions.o
functions.cpp: In function 'Sass::Expression* Sass::Functions::mix(Sass::Env&, Sass::Env&, Sass::Context&, Sass::Signature, Sass::ParserState, Sass::Backtrace*)':
functions.cpp:224:34: error: 'round' is not a member of 'std'
                                  std::round(w1*color1->r() + w2*color2->r()),
                                  ^
functions.cpp:224:34: note: suggested alternatives:
In file included from /usr/local/lib/gcc48/include/c++/cmath:44:0,
                 from /usr/local/lib/gcc48/include/c++/random:38,
                 from /usr/local/lib/gcc48/include/c++/bits/stl_algo.h:65,
                 from /usr/local/lib/gcc48/include/c++/algorithm:62,
                 from ast.hpp:11,
                 from functions.cpp:2:
/usr/include/math.h:273:8: note:   'round'
 double round(double);
        ^
In file included from functions.cpp:1:0:
functions.hpp:142:16: note:   'Sass::Functions::round'
     BUILT_IN(round);

@saper
Copy link
Member Author

saper commented Aug 19, 2015

Will need to undig #995 .. :(

@saper saper changed the title gcc48: functions.cpp:224:34: error: 'round' is not a member of 'std' g++48: functions.cpp:224:34: error: 'round' is not a member of 'std' Aug 19, 2015
@saper
Copy link
Member Author

saper commented Aug 19, 2015

furthermore, even gcc 4.9 on Solaris 2.9 does not recognize standard round() properly. Will investigate.

@saper
Copy link
Member Author

saper commented Aug 24, 2015

So, the reason is pretty simple - older versions of Solaris don't provide round() function at all.

@mgreter
Copy link
Contributor

mgreter commented Sep 10, 2015

What's the status here?

@xzyfer
Copy link
Contributor

xzyfer commented Sep 11, 2015

I guess we need a fix for the SunOS folk.

@xzyfer
Copy link
Contributor

xzyfer commented Sep 11, 2015

I'd like to have SunOS solved for 3.3

@saper
Copy link
Member Author

saper commented Sep 11, 2015

There are two related issues: one is that gcc libraries blindly assume glibc-like support for C and round is not put in the std:: namespace but is available via <math.h> as in C. On older systems there is no round at all. It could be solved with autoconf to detect the proper function, but we also need a non-autoconf solution. I think about adding round() to something like c99func.c

@mgreter
Copy link
Contributor

mgreter commented Jan 9, 2016

I'm pretty sure this should be solved by a commit I made for cygwin quite some time ago (seems to be the same problem as reported with round not in std:: but in in the root :: namespace).

@saper
Copy link
Member Author

saper commented Jan 9, 2016

The problem with older Solaris is that there is no round() function at all.

@mgreter
Copy link
Contributor

mgreter commented Jan 13, 2016

This should be fixed by #1847 (or even earlier).

@mgreter mgreter closed this as completed Jan 13, 2016
@saper saper reopened this Jan 23, 2016
@saper
Copy link
Member Author

saper commented Jan 23, 2016

/bin/bash ../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I/home/admini/saper/src/libsass/src  -I/home/admini/saper/src/libsass/include  -Wall -O2  -std=c++0x -g -O2 -MT util.lo -MD -MP -MF .deps/util.Tpo -c -o util.lo /home/admini/saper/src/libsass/src/util.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I/home/admini/saper/src/libsass/src -I/home/admini/saper/src/libsass/include -Wall -O2 -std=c++0x -g -O2 -MT util.lo -MD -MP -MF .deps/util.Tpo -c /home/admini/saper/src/libsass/src/util.cpp -fPIC -DPIC -o .libs/util.o
/home/admini/saper/src/libsass/src/util.cpp: In function ‘double Sass::round(double, std::size_t)’:
/home/admini/saper/src/libsass/src/util.cpp:28:12: error: ‘::round’ has not been declared
     return ::round(val);
            ^
/home/admini/saper/src/libsass/src/util.cpp:28:12: note: suggested alternative:
/home/admini/saper/src/libsass/src/util.cpp:20:10: note:   ‘Sass::round’
   double round(double val, size_t precision)
          ^
/home/admini/saper/src/libsass/src/util.cpp:29:3: warning: control reaches end of non-void function [-Wreturn-type]
   }
   ^
GNUmakefile:618: recipe for target 'util.lo' failed
make[2]: *** [util.lo] Error 1

@mgreter
Copy link
Contributor

mgreter commented Dec 6, 2016

Any progress here? Not sure if it's worth to keep this open, as Solaris 9 had its EOL October 2014?

@xzyfer
Copy link
Contributor

xzyfer commented Dec 6, 2016

If someone wants to submit a patch we'll take a look

@xzyfer xzyfer closed this as completed Dec 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants