*: remove "pure" and "const" attributes from throwing functions
The "pure" and "const" attributes are not so well-defined, and a recent clang version implements an optimization which pushes the definition's boundary beyond what I believed it was. clang now assumes that functions declared "pure" cannot throw exceptions, even if they lack the "noexcept" specification. When compiled with this new clang version, MPD will crash randomly if an exception happens to get thrown by such as "pure" function (https://github.com/MusicPlayerDaemon/MPD/issues/41). This commit removes all such misplaced "pure" and "const" attributes, closing #41.
This commit is contained in:
@@ -159,7 +159,7 @@ public:
|
||||
* Convert a UTF-8 C string to an #AllocatedPath instance.
|
||||
* Throws a std::runtime_error on error.
|
||||
*/
|
||||
gcc_pure gcc_nonnull_all
|
||||
gcc_nonnull_all
|
||||
static AllocatedPath FromUTF8Throw(const char *path_utf8);
|
||||
|
||||
/**
|
||||
|
@@ -49,7 +49,7 @@ DeinitFSCharset() noexcept;
|
||||
*
|
||||
* Throws std::runtime_error on error.
|
||||
*/
|
||||
gcc_pure gcc_nonnull_all
|
||||
gcc_nonnull_all
|
||||
PathTraitsUTF8::string
|
||||
PathToUTF8(PathTraitsFS::const_pointer_type path_fs);
|
||||
|
||||
@@ -58,7 +58,7 @@ PathToUTF8(PathTraitsFS::const_pointer_type path_fs);
|
||||
*
|
||||
* Throws std::runtime_error on error.
|
||||
*/
|
||||
gcc_pure gcc_nonnull_all
|
||||
gcc_nonnull_all
|
||||
PathTraitsFS::string
|
||||
PathFromUTF8(PathTraitsUTF8::const_pointer_type path_utf8);
|
||||
|
||||
|
@@ -65,7 +65,6 @@ public:
|
||||
* it). Throws std::runtime_error if not enough data is
|
||||
* available.
|
||||
*/
|
||||
gcc_pure
|
||||
void *ReadFull(size_t size);
|
||||
|
||||
void Consume(size_t n) {
|
||||
|
@@ -86,7 +86,6 @@ public:
|
||||
|
||||
void Close();
|
||||
|
||||
gcc_pure
|
||||
FileInfo GetFileInfo() const;
|
||||
|
||||
gcc_pure
|
||||
|
Reference in New Issue
Block a user