MSVC C6387 Warning · Issue #7108 · Protocolbuffers/protobuf · GitHub
- Notifications You must be signed in to change notification settings
- Fork 16k
- Star 70k
- Code
- Issues 167
- Pull requests 70
- Actions
- Projects 0
- Wiki
- Security
Uh oh!
There was an error while loading. Please reload this page.
- Insights
Description
What version of protobuf and what language are you using? Version: v3.11.2 Language: C++
What operating system (Linux, Windows, ...) and version? Windows 10 x64
What runtime / compiler are you using (e.g., python version or gcc version) MSVC 2019
What did you do? Steps to reproduce the behavior:
- create a proto3 message with a string field called String1
- use protoc to compile to C++
- compile the generated source using MSVC
What did you expect to see No C6387 warning
What did you see instead? C6387 warning 'value' could be '0': this does not adhere to the specification for the function 'std::basic_string<char,std::char_traits,std::allocator >::{ctor}'
The generated source is
inline void Proto1::set_string1(const char* value) { GOOGLE_DCHECK(value != nullptr); string1_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); // @@protoc_insertion_point(field_set_char:Proto1.String1) }It seems MSVC does not understand GOOGLE_DCHECK(value != nullptr);
If use ::std::string(value ? value : ""), the warning goes away.
Metadata
Metadata
Assignees
No one assignedLabels
Any issue releated to specific platform or OSType
No typeProjects
No projectsMilestone
No milestoneRelationships
None yetDevelopment
No branches or pull requestsIssue actions
You can’t perform that action at this time.Từ khóa » C C6387
-
C6387 - Microsoft Docs
-
Warning C6387 Visual Studio - C++ - Stack Overflow
-
Fake Warning C6387 With Exception - Visual Studio Feedback
-
256MB Lifebook C6387, C6637 C-Series Memory Upgrades
-
Warning C6387 Visual Studio - Anycodings
-
C6387 - Etsy
-
What Does This Error Message Mean? - C Board
-
7001. Jaguar C-Type Correct Shape Top Hose With Kevlar ...
-
How To Fix The Child Dialog Position Inside A Parent Dialog
-
C/C++ - LAST SECTOR
-
C语言c6387警告这不符合函数“fgetc”的规范。-程序员博客中心
-
NEW! DAMCOS SUPERFOS AS_POS10 HYDRAULIC SPRING ...
-
Warning C6387 Visual Studio - Qandeel Academy
-
PANASONIC Electrolytic Capacitors Series EB Radial Rated Voltage