Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: niffiwan on July 11, 2013, 10:04:52 pm
-
This is an interesting read that I stumbled across today, there's some tips in there for VS, gcc & clang.
http://randomascii.wordpress.com/2013/06/24/two-years-and-thousands-of-bugs-of-static-analysis/
-
well, i've ran fso antipodes r9580 debug build compilation through it. have fun with the results: download (http://www.egzodus.com/dir/clang-analysis-fso-ant-r9580.7z)
beware, the uncompressed folder is 844MB
for the record my system is 3.8.13-gentoo, x64, running on a core i7 860, 8 gigs of ram, and this is my trivial compile script
#!/bin/bash
CC="clang"
CXX="clang++"
CFLAGS="-march=native -pipe"
CXXFLAGS="${CFLAGS}"
cd ~/dev/FSO_Antipodes
make clean
scan-build -v -o ~/temp/clangOut ./configure CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" --enable-debug #CC=${CC} CXX=${CXX}
scan-build -v -o ~/temp/clangOut make -j8
also, FSO compiles fine with clang, but i havent tried running anything with it yet.
(if its useful to anyone, yay, if not, oh well)
[edit] running a recompile now, since i missed nice little detail about the compile script which resulted in CXXFLAGS not being applied at all. if my explicit declaration of -std=c++0x is slightly retarded, call me out on it.
[edit 2]yeah, it doesnt compile with the -std=c++0x, and i'm not about to go debug it specifically. the stuff that i linked for download should be accurate for a normal compile without the -std=c++0x option.
[edit 3]fixed the download so that it actually works.
-
the things people will do to avoid using a language with a proper type system
-
the things people will do to avoid using a language with a proper type system
Please elaborate. C/C++ seem to have a rather solid type system already (unlike, say, Lua).
-
Here's (http://www.egzodus.com/dir/clang-analysis-fso-trunk-r9720.7z) a proper package containing the analysis for trunk r9720.
I should've looked at the latest commit log for antipodes... :p
-
the things people will do to avoid using a language with a proper type system
Please elaborate. C/C++ seem to have a rather solid type system already (unlike, say, Lua).
By which you mean they have an (explicit) type system; which, as far as the programming mainstream goes, is about the furthest you'll go. But if you look at something like e.g. Haskell's type system, it's worlds ahead of C's crude byte-counter, and there's stuff that's even more sophisticated still (https://en.wikipedia.org/wiki/Dependent_type), and in which something as primitive as printf would be completely crazy.