mirror of
https://github.com/Tencent/rapidjson.git
synced 2025-03-09 11:09:32 +01:00
Try to fix clang and gcc warnings problems again x9
Abandon RAPIDJSON_NORETURN_SUFFIX
This commit is contained in:
parent
efdbdc6016
commit
5c003f3ecb
@ -22,6 +22,7 @@
|
||||
RAPIDJSON_DIAG_PUSH
|
||||
RAPIDJSON_DIAG_OFF(padded)
|
||||
RAPIDJSON_DIAG_OFF(unreachable-code)
|
||||
RAPIDJSON_DIAG_OFF(missing-noreturn)
|
||||
#endif
|
||||
|
||||
RAPIDJSON_NAMESPACE_BEGIN
|
||||
@ -51,8 +52,8 @@ public:
|
||||
size_t Tell() const { return count_ + static_cast<size_t>(current_ - buffer_); }
|
||||
|
||||
// Not implemented
|
||||
void Put(Ch) RAPIDJSON_NORETURN_SUFFIX { RAPIDJSON_ASSERT(false); }
|
||||
void Flush() RAPIDJSON_NORETURN_SUFFIX { RAPIDJSON_ASSERT(false); }
|
||||
void Put(Ch) { RAPIDJSON_ASSERT(false); }
|
||||
void Flush() { RAPIDJSON_ASSERT(false); }
|
||||
Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; }
|
||||
size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; }
|
||||
|
||||
|
@ -20,6 +20,7 @@
|
||||
#ifdef __clang__
|
||||
RAPIDJSON_DIAG_PUSH
|
||||
RAPIDJSON_DIAG_OFF(unreachable-code)
|
||||
RAPIDJSON_DIAG_OFF(missing-noreturn)
|
||||
#endif
|
||||
|
||||
RAPIDJSON_NAMESPACE_BEGIN
|
||||
@ -46,8 +47,8 @@ struct MemoryStream {
|
||||
size_t Tell() const { return static_cast<size_t>(src_ - begin_); }
|
||||
|
||||
Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; }
|
||||
void Put(Ch) RAPIDJSON_NORETURN_SUFFIX { RAPIDJSON_ASSERT(false); }
|
||||
void Flush() RAPIDJSON_NORETURN_SUFFIX { RAPIDJSON_ASSERT(false); }
|
||||
void Put(Ch) { RAPIDJSON_ASSERT(false); }
|
||||
void Flush() { RAPIDJSON_ASSERT(false); }
|
||||
size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; }
|
||||
|
||||
// For encoding detection only.
|
||||
|
@ -464,15 +464,6 @@ RAPIDJSON_NAMESPACE_END
|
||||
|
||||
#endif // RAPIDJSON_DIAG_*
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// RAPIDJSON_NORETURN_SUFFIX
|
||||
|
||||
#if defined(__clang__) && !defined(NDEBUG)
|
||||
#define RAPIDJSON_NORETURN_SUFFIX __attribute__ ((noreturn))
|
||||
#else
|
||||
#define RAPIDJSON_NORETURN_SUFFIX
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// C++11 features
|
||||
|
||||
|
@ -25,6 +25,7 @@ using namespace rapidjson;
|
||||
RAPIDJSON_DIAG_PUSH
|
||||
RAPIDJSON_DIAG_OFF(effc++)
|
||||
RAPIDJSON_DIAG_OFF(float-equal)
|
||||
RAPIDJSON_DIAG_OFF(missing-noreturn)
|
||||
#endif
|
||||
|
||||
#ifdef __clang__
|
||||
@ -1040,8 +1041,8 @@ public:
|
||||
size_t Tell() const { return static_cast<size_t>(is_.tellg()); }
|
||||
|
||||
Ch* PutBegin() { assert(false); return 0; }
|
||||
void Put(Ch) RAPIDJSON_NORETURN_SUFFIX { assert(false); }
|
||||
void Flush() RAPIDJSON_NORETURN_SUFFIX { assert(false); }
|
||||
void Put(Ch) { assert(false); }
|
||||
void Flush() { assert(false); }
|
||||
size_t PutEnd(Ch*) { assert(false); return 0; }
|
||||
|
||||
private:
|
||||
|
Loading…
x
Reference in New Issue
Block a user