{"action":"created","issue":{"url":"https://api.github.com/repos/yandex/handystats/issues/4","repository_url":"https://api.github.com/repos/yandex/handystats","labels_url":"https://api.github.com/repos/yandex/handystats/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/yandex/handystats/issues/4/comments","events_url":"https://api.github.com/repos/yandex/handystats/issues/4/events","html_url":"https://github.com/yandex/handystats/pull/4","id":153643407,"number":4,"title":"Fix for GCC 5.3.1, Ubuntu 16.04 LTS, 64-bit","user":{"login":"abclogin","id":1755334,"avatar_url":"https://avatars.githubusercontent.com/u/1755334?v=3","gravatar_id":"","url":"https://api.github.com/users/abclogin","html_url":"https://github.com/abclogin","followers_url":"https://api.github.com/users/abclogin/followers","following_url":"https://api.github.com/users/abclogin/following{/other_user}","gists_url":"https://api.github.com/users/abclogin/gists{/gist_id}","starred_url":"https://api.github.com/users/abclogin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abclogin/subscriptions","organizations_url":"https://api.github.com/users/abclogin/orgs","repos_url":"https://api.github.com/users/abclogin/repos","events_url":"https://api.github.com/users/abclogin/events{/privacy}","received_events_url":"https://api.github.com/users/abclogin/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-05-08T08:17:45Z","updated_at":"2016-09-26T11:18:00Z","closed_at":"2016-09-26T09:29:10Z","pull_request":{"url":"https://api.github.com/repos/yandex/handystats/pulls/4","html_url":"https://github.com/yandex/handystats/pull/4","diff_url":"https://github.com/yandex/handystats/pull/4.diff","patch_url":"https://github.com/yandex/handystats/pull/4.patch"},"body":"I compile on Ubuntu 16.04 LTS 64-bit using GCC 5.3.1, GPP 2.24\r\n\r\n\r\nError in:\r\n\r\n\r\n> [  3%] Building CXX object CMakeFiles/handystats.dir/src/config.cpp.o\r\n> In file included from /builds/handystats/src/config.cpp:31:0:\r\n> /builds/handystats/include/handystats/rapidjson/writer.h: In member function ‘void rapidjson::Writer<OutputStream, SourceEncoding, TargetEncoding, Allocator>::WriteDouble(double)’:\r\n> /builds/handystats/include/handystats/rapidjson/writer.h:167:14: warning: there are no arguments to ‘isnan’ that depend on a template parameter, so a declaration of ‘isnan’ must be available [-fpermissive]\r\n>    if (isnan(d)) {\r\n>               ^\r\n> /home/username/coca/handystats/include/handystats/rapidjson/writer.h: In instantiation of ‘void rapidjson::Writer<OutputStream, SourceEncoding, TargetEncoding, Allocator>::WriteDouble(double) [with OutputStream = rapidjson::GenericStringBuffer<rapidjson::UTF8<>, rapidjson::MemoryPoolAllocator<> >; SourceEncoding = rapidjson::UTF8<>; TargetEncoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>]’:\r\n> /builds/handystats/include/handystats/rapidjson/writer.h:49:62:   required from ‘rapidjson::Writer<OutputStream, SourceEncoding, TargetEncoding, Allocator>& rapidjson::Writer<OutputStream, SourceEncoding, TargetEncoding, Allocator>::Double(double) [with OutputStream = rapidjson::GenericStringBuffer<rapidjson::UTF8<>, rapidjson::MemoryPoolAllocator<> >; SourceEncoding = rapidjson::UTF8<>; TargetEncoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>]’\r\n> /builds/handystats/include/handystats/rapidjson/document.h:552:13:   required from ‘const rapidjson::GenericValue<Encoding, Allocator>& rapidjson::GenericValue<Encoding, Allocator>::Accept(Handler&) const [with Handler = rapidjson::Writer<rapidjson::GenericStringBuffer<rapidjson::UTF8<>, rapidjson::MemoryPoolAllocator<> > >; Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>]’\r\n> /builds/handystats/src/config.cpp:199:22:   required from here\r\n> /builds/handystats/include/handystats/rapidjson/writer.h:167:12: error: ‘isnan’ was not declared in this scope\r\n>    if (isnan(d)) {\r\n>             ^\r\n> /builds/handystats/include/handystats/rapidjson/writer.h:167:12: note: suggested alternative:\r\n> In file included from /builds/handystats/include/handystats/rapidjson/writer.h:9:0,\r\n>                  from /builds/handystats/src/config.cpp:31:\r\n> /usr/include/c++/5/cmath:641:5: note:   ‘std::isnan’\r\n>      isnan(_Tp __x)\r\n>      ^\r\n> CMakeFiles/handystats.dir/build.make:254: recipe for target 'CMakeFiles/handystats.dir/src/config.cpp.o' failed\r\n> make[2]: *** [CMakeFiles/handystats.dir/src/config.cpp.o] Error 1\r\n> CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/handystats.dir/all' failed\r\n> make[1]: *** [CMakeFiles/handystats.dir/all] Error 2\r\n> Makefile:138: recipe for target 'all' failed\r\n> make: *** [all] Error 2\r\n\r\n\r\nI read this answer:\r\n\r\n\r\nhttp://stackoverflow.com/a/18129007\r\n\r\n\r\n> It depends on which header you include. If you include the C header <math.h> (which is part of C++, albeit marked as deprecated), then you can use the unqualified C functions, like isnan. If you on the other hand include the C++ header <cmath>, you are only guaranteed that it brings all the functions from <math.h> into the std namespace and thus you have to properly qualify them, like std::isnan (or use some kind of using directive). Unfortunately an implementation is allowed but not required to bring those functions into the global namespace, too, when including <cmath> (and thus it is one of the many \"works on my machine\"-incidences of C++ and the reason why many people write code like you just tried to compile unsuccessfully).\r\n> \r\n> So to sum up: Either include <math.h> and use isnan or include <cmath> and use std::isnan, everything else is non-portable. Of course all this applies to any other C header and its respective C++ version, too.\r\n> \r\n> EDIT: It should be noted though, that this particular function isnan is only supported since C++11 and wasn't available in C++98 at all (which may be part of your confusion). But this doesn't change anything in this situation because in C++98 neither <cmath> nor <math.h> (which was the actual C89/C90 header back then and not the C99 header that C++11 includes) had this function, since they're always in-sync. So what this library from your question maybe tried was to use C++98 while taking the isnan function from a different C99 implementation (which isn't a particularly good idea, as it might conflict with the C89/C90 parts of the C++ implementation, never even tried this though).\r\n> \r\n\r\nI added \"std::\" prefix to isnan call. Compilation is successfully.\r\n\r\nAttention!\r\n\r\nIt may be incompatible with older versions of the compiler."},"comment":{"url":"https://api.github.com/repos/yandex/handystats/issues/comments/249543364","html_url":"https://github.com/yandex/handystats/pull/4#issuecomment-249543364","issue_url":"https://api.github.com/repos/yandex/handystats/issues/4","id":249543364,"user":{"login":"minaevmike","id":2682948,"avatar_url":"https://avatars.githubusercontent.com/u/2682948?v=3","gravatar_id":"","url":"https://api.github.com/users/minaevmike","html_url":"https://github.com/minaevmike","followers_url":"https://api.github.com/users/minaevmike/followers","following_url":"https://api.github.com/users/minaevmike/following{/other_user}","gists_url":"https://api.github.com/users/minaevmike/gists{/gist_id}","starred_url":"https://api.github.com/users/minaevmike/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minaevmike/subscriptions","organizations_url":"https://api.github.com/users/minaevmike/orgs","repos_url":"https://api.github.com/users/minaevmike/repos","events_url":"https://api.github.com/users/minaevmike/events{/privacy}","received_events_url":"https://api.github.com/users/minaevmike/received_events","type":"User","site_admin":false},"created_at":"2016-09-26T11:18:00Z","updated_at":"2016-09-26T11:18:00Z","body":"FINALLY THX"}}
{"actor":{"display_login":"minaevmike"}}