diff --git a/cfg/std.cfg b/cfg/std.cfg index c93859efb..4545c5429 100644 --- a/cfg/std.cfg +++ b/cfg/std.cfg @@ -4023,9 +4023,27 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun + + false + + + + + 0: + + + + false + + + + + false + false + @@ -4047,6 +4065,16 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun 0: + + false + + + + + false + + + diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index 672dccd04..ef76f6ae8 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -5001,6 +5001,18 @@ bool ValueType::fromLibraryType(const std::string &typestr, const Settings *sett if (platformType->_const_ptr) constness = 1; return true; + } else if (!podtype && (typestr == "size_t" || typestr == "std::size_t")) { + originalTypeName = "size_t"; + sign = ValueType::UNSIGNED; + if (settings->sizeof_size_t == settings->sizeof_long) + type = ValueType::Type::LONG; + else if (settings->sizeof_size_t == settings->sizeof_long_long) + type = ValueType::Type::LONGLONG; + else if (settings->sizeof_size_t == settings->sizeof_int) + type = ValueType::Type::INT; + else + type = ValueType::Type::UNKNOWN_INT; + return true; } return false;