| Summary: | devel/jsoncpp: Faila to build on sparc64: snprintf is not a member of std | ||
|---|---|---|---|
| Product: | Ports & Packages | Reporter: | Michał "phoe" Herda <phoe> |
| Component: | Individual Port(s) | Assignee: | freebsd-ports-bugs (Nobody) <ports-bugs> |
| Status: | Closed Overcome By Events | ||
| Severity: | Affects Only Me | CC: | brooks, emaste, linimon, w.schwarzenfeld, yuri |
| Priority: | --- | Keywords: | needs-qa |
| Version: | Latest | Flags: | bugzilla:
maintainer-feedback?
(yuri) koobs: merge-quarterly? |
| Hardware: | sparc64 | ||
| OS: | Any | ||
I don't have sparc, and didn't know it is still in use. Patches are welcome! Hi Yuri, I will need some help with making the patch - I am not proficient with C/C++ enough to do it on my own. I suggest I will need some help with the preprocessor directives, like adding one more check for sparc64 in the ifdefs. Once it is done, I will need some kind of CI check to make sure this package still builds on all other architectures. ~phoe 1. Create a copy of each file that you need to change with .orig extension 2. Modify the files 3. Run 'make patch' to generate corresponding patches (under files/) 4. Run 'svn add file/patch-...' to add the patches 5. Run 'svn patch' to generate a patch (In reply to Yuri Victorovich from comment #1) I have several machines here, one of which is dedicated to building packages (see https://wiki.freebsd.org/Sparc64Packages). I can test package builds for anyone that needs it on one of the spares. I think this is a problem of C++ support on FreeBSD. CCed to clang maintainer, because this looks like a generic C++ support problem. Is this building using a clang port or package, or is it using the in-tree (for sparc64) GCC 4.2.1? I no longer have a FreeBSD installation available to work on this bug. Is this overcome by events? (In reply to w.schwarzenfeld from comment #9) I didn't hear people complain. Michał, please reopen this if this is still a problem. |
Requires patches to build on 11.0-RELEASE on sparc64. For making it compile, I needed to comment out the preprocessor lines which "#define snprintf std::snprintf" in the following files: src/lib_json/json_writer.cpp src/lib_json/json_reader.cpp The errors generated are like: src/lib_json/json_writer.cpp: In function 'std::__cxx11::string Json::valueToString(double, bool, unsigned int)': src/lib_json/json_writer.cpp:61:18: error: 'snprintf' is not a member of 'std' #define snprintf std::snprintf ^ src/lib_json/json_writer.cpp:151:11: note: in expansion of macro 'snprintf' len = snprintf(buffer, sizeof(buffer), formatString, value); ^ src/lib_json/json_writer.cpp:61:18: note: suggested alternative: #define snprintf