Skip to content

Commit 6e2d530

Browse files
bwellingaardappel
authored andcommitted
Fix incorrect code generation on Solaris Sparc. (google#5208)
On Solaris Sparc, calling NumToString() with a char called the primary version, not the signed char or unsigned char specializations, which caused integer to string conversions to be missed.
1 parent 9bf9b18 commit 6e2d530

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

include/flatbuffers/util.h

+3
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ template<> inline std::string NumToString<signed char>(signed char t) {
130130
template<> inline std::string NumToString<unsigned char>(unsigned char t) {
131131
return NumToString(static_cast<int>(t));
132132
}
133+
template<> inline std::string NumToString<char>(char t) {
134+
return NumToString(static_cast<int>(t));
135+
}
133136
#if defined(FLATBUFFERS_CPP98_STL)
134137
template<> inline std::string NumToString<long long>(long long t) {
135138
char buf[21]; // (log((1 << 63) - 1) / log(10)) + 2

0 commit comments

Comments
 (0)