The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: jamespetts on March 24, 2013, 11:35:35 AM

Title: Compiling with Clang
Post by: jamespetts on March 24, 2013, 11:35:35 AM
In a post (http://forum.simutrans.com/index.php?topic=11652) in the Experimental forum, M. Collett writes about the difficulties in getting the latest Experimental release candidate to compile with Clang, a compiler used by default in the latest version of Mac OS X. It seems that several of these difficulties apply also to Standard, since they are present in code that is unchanged from Standard, so I thought that it might be useful to alert the Standard developers to the fact. I hope that this is helpful. The solutions to the compile issues are also addressed.
Title: Re: Compiling with Clang
Post by: Dwachs on March 24, 2013, 01:34:32 PM
thanks for reporting. I committed the alloca - fix, the other issues were experimental-specific, the crash with gui_button is not reproducable in standard (at least by me).
Title: Re: Compiling with Clang
Post by: tlp on March 24, 2013, 07:05:44 PM
Can the #include <alloca.h> be replaced with #include <stdlib.h>? Clang is also the default on FreeBSD 10 but alloca.h does not exist there and stdlib.h should work on MacOS too according to https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man3/alloca.3.html
Title: Re: Compiling with Clang
Post by: Dwachs on March 24, 2013, 07:52:39 PM
changed. hope this works now.