widelands-dev team mailing list archive
-
widelands-dev team
-
Mailing list archive
-
Message #00766
[Merge] lp:~peter.waller/widelands/fix-clang-crashes into lp:widelands
Peter Waller has proposed merging lp:~peter.waller/widelands/fix-clang-crashes into lp:widelands.
Requested reviews:
Widelands Developers (widelands-dev)
Related bugs:
Bug #744595 in widelands: "clang llvm 2.9 compiler widelands crash"
https://bugs.launchpad.net/widelands/+bug/744595
Bug #913369 in widelands: "Warnings at compile-time (clang/llvm)"
https://bugs.launchpad.net/widelands/+bug/913369
For more details, see:
https://code.launchpad.net/~peter.waller/widelands/fix-clang-crashes/+merge/103991
I have removed __attribute__((noreturn)) from widelands because it causes clang to generate incorrect code and crash. There was one (or more) legitimate use, but I think the attribute is dangerous enough to leave it out and fix the warnings some other way.
With this fix, widelands ran for a full 10 hour 3-player AI game without crashing.
--
https://code.launchpad.net/~peter.waller/widelands/fix-clang-crashes/+merge/103991
Your team Widelands Developers is requested to review the proposed merge of lp:~peter.waller/widelands/fix-clang-crashes into lp:widelands.
=== modified file 'src/economy/idleworkersupply.h'
--- src/economy/idleworkersupply.h 2012-02-15 21:25:34 +0000
+++ src/economy/idleworkersupply.h 2012-04-28 17:49:28 +0000
@@ -43,8 +43,7 @@
virtual void send_to_storage(Game &, Warehouse * wh);
virtual uint32_t nr_supplies(Game const &, Request const &) const;
- virtual WareInstance & launch_item(Game &, Request const &)
- __attribute__ ((noreturn));
+ virtual WareInstance & launch_item(Game &, Request const &);
virtual Worker & launch_worker(Game &, Request const &);
private:
=== modified file 'src/economy/ware_instance.cc'
--- src/economy/ware_instance.cc 2012-02-15 21:25:34 +0000
+++ src/economy/ware_instance.cc 2012-04-28 17:49:28 +0000
@@ -60,8 +60,7 @@
virtual uint32_t nr_supplies(Game const &, Request const &) const;
virtual WareInstance & launch_item(Game &, Request const &);
- virtual Worker & launch_worker(Game &, Request const &)
- __attribute__ ((noreturn));
+ virtual Worker & launch_worker(Game &, Request const &);
private:
WareInstance & m_ware;
=== modified file 'src/io/filesystem/zip_filesystem.h'
--- src/io/filesystem/zip_filesystem.h 2012-02-15 21:25:34 +0000
+++ src/io/filesystem/zip_filesystem.h 2012-04-28 17:49:28 +0000
@@ -58,17 +58,15 @@
virtual void MakeDirectory (std::string const & dirname);
virtual StreamRead * OpenStreamRead
- (const std::string & fname) __attribute__ ((noreturn));
+ (const std::string & fname);
virtual StreamWrite * OpenStreamWrite
- (const std::string & fname) __attribute__ ((noreturn));
+ (const std::string & fname);
virtual FileSystem & MakeSubFileSystem(std::string const & dirname);
virtual FileSystem & CreateSubFileSystem
(std::string const & dirname, Type);
- virtual void Unlink(std::string const & filename)
- __attribute__ ((noreturn));
- virtual void Rename(std::string const &, std::string const &)
- __attribute__ ((noreturn));
+ virtual void Unlink(std::string const & filename);
+ virtual void Rename(std::string const &, std::string const &);
virtual unsigned long long DiskSpace();
=== modified file 'src/io/streamread.h'
--- src/io/streamread.h 2012-02-15 21:25:34 +0000
+++ src/io/streamread.h 2012-04-28 17:49:28 +0000
@@ -71,7 +71,7 @@
int32_t Signed32();
uint32_t Unsigned32();
std::string String();
- __attribute__((noreturn)) virtual char const * CString() {throw;}
+ virtual char const * CString() {throw;}
/// Base of all exceptions that are caused by errors in the data that is
/// read.
=== modified file 'src/logic/building.h'
--- src/logic/building.h 2012-02-15 21:25:34 +0000
+++ src/logic/building.h 2012-04-28 17:49:28 +0000
@@ -178,7 +178,7 @@
virtual std::string get_statistics_string();
/// \returns the queue for a ware type or \throws _wexception.
- virtual WaresQueue & waresqueue(Ware_Index) __attribute__ ((noreturn));
+ virtual WaresQueue & waresqueue(Ware_Index);
virtual bool burn_on_destroy();
virtual void destroy(Editor_Game_Base &);
@@ -187,8 +187,7 @@
void hide_options();
virtual bool fetch_from_flag(Game &);
- virtual bool get_building_work(Game &, Worker &, bool success)
- __attribute__ ((noreturn));
+ virtual bool get_building_work(Game &, Worker &, bool success);
bool leave_check_and_wait(Game &, Worker &);
void leave_skip(Game &, Worker &);
=== modified file 'src/wlapplication.cc'
--- src/wlapplication.cc 2012-04-26 11:02:10 +0000
+++ src/wlapplication.cc 2012-04-28 17:49:28 +0000
@@ -2131,7 +2131,7 @@
}
}
- __attribute__((noreturn)) void sendPlayerCommand(Widelands::PlayerCommand &)
+ void sendPlayerCommand(Widelands::PlayerCommand &)
{
throw wexception("Trying to send a player command during replay");
}
Follow ups