facebook/hhvm — pull request #2756 by tomkwok (2014-05-24 06:02:37+00:00)
Title: Fix Clang compilation fatal error and warnings

Clang compilation failure caused by 92edee6ca64e50f9167ff43521c40d2369ab631c which adds `-stdlib=libc++` to CMAKE_CXX_FLAGS and `-fast` to both CMAKE_C_FLAGS_RELEASE and CMAKE_CXX_FLAGS_RELEASE

logs (Clang 3.4.1, Arch)
~~~
[ 0%] [ 0%] Building C object third-party/libsqlite3/CMakeFiles/sqlite3.dir/sqlite3.c.o
Building C object third-party/libafdt/CMakeFiles/afdt.dir/src/lowlevel.c.o
clang: warning: argument unused during compilation: '-fast'
clang: warning: argument unused during compilation: '-fast'
[ 0%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/mbfilter.c.o
clang: warning: argument unused during compilation: '-fast'
[ 0%] Building C object third-party/libafdt/CMakeFiles/afdt.dir/src/strlcpy.c.o
clang: warning: argument unused during compilation: '-fast'
[ 0%] Building C object third-party/libafdt/CMakeFiles/afdt.dir/src/sync.c.o
clang: warning: argument unused during compilation: '-fast'
[ 1%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/mbfl_string.c.o
[ 1%] clang: warning: argument unused during compilation: '-fast'
Building C object third-party/libafdt/CMakeFiles/afdt.dir/src/util.c.o
clang: warning: argument unused during compilation: '-fast'
[ 1%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/mbfl_language.c.o
clang: warning: argument unused during compilation: '-fast'
[ 1%] Building C object third-party/libafdt/CMakeFiles/afdt.dir/src/async.c.o
/path/to/hhvm/third-party/libmbfl/mbfl/mbfl_language.c:101:7: warning: implicitly declaring library function 'strcasecmp' with type 'int (const char *, const char *)'
if (strcasecmp(language->name, name) == 0) {
^
/path/to/hhvm/third-party/libmbfl/mbfl/mbfl_language.c:101:7: note: please include the header or explicitly provide a declaration for 'strcasecmp'
1 warning generated.
clang: warning: argument unused during compilation: '-fast'
[ 1%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/mbfl_encoding.c.o
clang: warning: argument unused during compilation: '-fast'
/path/to/hhvm/third-party/libmbfl/mbfl/mbfl_encoding.c:207:7: warning: implicitly declaring library function 'strcasecmp' with type 'int (const char *, const char *)'
if (strcasecmp(encoding->name, name) == 0) {
^
/path/to/hhvm/third-party/libmbfl/mbfl/mbfl_encoding.c:207:7: note: please include the header or explicitly provide a declaration for 'strcasecmp'
1 warning generated.
Linking C static library libafdt.a
[ 1%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/mbfl_convert.c.o
clang: warning: argument unused during compilation: '-fast'
[ 1%] Built target afdt
[ 1%] Building C object third-party/timelib/CMakeFiles/timelib.dir/astro.c.o
[ 1%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/mbfl_ident.c.o
clang: warning: argument unused during compilation: '-fast'
clang: warning: argument unused during compilation: '-fast'
[ 1%] [ 1%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/mbfl_memory_device.c.o
Building C object third-party/timelib/CMakeFiles/timelib.dir/dow.c.o
clang: warning: argument unused during compilation: '-fast'
clang: warning: argument unused during compilation: '-fast'
/path/to/hhvm/third-party/libmbfl/mbfl/mbfl_memory_device.c:221:4: warning: assigning to 'const unsigned char *' from 'const char *' converts between pointers to integer types with different sign [-Wpointer-sign]
p = psrc;
^ ~~~~
/path/to/hhvm/third-party/libmbfl/mbfl/mbfl_memory_device.c:238:4: warning: assigning to 'const unsigned char *' from 'const char *' converts between pointers to integer types with different sign [-Wpointer-sign]
p = psrc;
^ ~~~~
2 warnings generated.
[ 1%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/mbfl_allocators.c.o
[ 1%] clang: warning: argument unused during compilation: '-fast'
Building C object third-party/timelib/CMakeFiles/timelib.dir/interval.c.o
/path/to/hhvm/third-party/libmbfl/mbfl/mbfl_allocators.c:76:9: warning: implicitly declaring library function 'malloc' with type 'void *(unsigned long)'
return malloc(sz);
^
/path/to/hhvm/third-party/libmbfl/mbfl/mbfl_allocators.c:76:9: note: please include the header or explicitly provide a declaration for 'malloc'
/path/to/hhvm/third-party/libmbfl/mbfl/mbfl_allocators.c:81:9: warning: implicitly declaring library function 'realloc' with type 'void *(void *, unsigned long)'
return realloc(ptr, sz);
^
/path/to/hhvm/third-party/libmbfl/mbfl/mbfl_allocators.c:81:9: note: please include the header or explicitly provide a declaration for 'realloc'
/path/to/hhvm/third-party/libmbfl/mbfl/mbfl_allocators.c:86:9: warning: implicitly declaring library function 'calloc' with type 'void *(unsigned long, unsigned long)'
return calloc(nelems, szelem);
^
/path/to/hhvm/third-party/libmbfl/mbfl/mbfl_allocators.c:86:9: note: please include the header or explicitly provide a declaration for 'calloc'
/path/to/hhvm/third-party/libmbfl/mbfl/mbfl_allocators.c:91:2: warning: implicit declaration of function 'free' is invalid in C99 [-Wimplicit-function-declaration]
free(ptr);
^
clang: warning: argument unused during compilation: '-fast'
4 warnings generated.
[ 1%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/mbfl_filter_output.c.o
clang: warning: argument unused during compilation: '-fast'
[ 1%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/mbfilter_pass.c.o
[ 1%] Building C object third-party/timelib/CMakeFiles/timelib.dir/parse_date.c.o
clang: warning: argument unused during compilation: '-fast'
clang: warning: argument unused during compilation: '-fast'
[ 1%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/mbfilter_wchar.c.o
clang: warning: argument unused during compilation: '-fast'
[ 1%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/mbfilter_8bit.c.o
clang: warning: argument unused during compilation: '-fast'
[ 1%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_cp936.c.o
clang: warning: argument unused during compilation: '-fast'
[ 1%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_hz.c.o
clang: warning: argument unused during compilation: '-fast'
[ 1%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_euc_tw.c.o
clang: warning: argument unused during compilation: '-fast'
[ 1%] Building C object third-party/timelib/CMakeFiles/timelib.dir/parse_iso_intervals.c.o
clang: warning: argument unused during compilation: '-fast'
[ 1%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_big5.c.o
clang: warning: argument unused during compilation: '-fast'
[ 2%] Building C object third-party/timelib/CMakeFiles/timelib.dir/parse_tz.c.o
clang: warning: argument unused during compilation: '-fast'
[ 2%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_euc_jp.c.o
clang: warning: argument unused during compilation: '-fast'
[ 3%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_jis.c.o
clang: warning: argument unused during compilation: '-fast'
[ 3%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_iso8859_1.c.o
clang: warning: argument unused during compilation: '-fast'
[ 3%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_iso8859_2.c.o
clang: warning: argument unused during compilation: '-fast'
[ 3%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_cp1254.c.o
clang: warning: argument unused during compilation: '-fast'
[ 3%] [ 3%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_cp1252.c.o
Building C object third-party/timelib/CMakeFiles/timelib.dir/timelib.c.o
clang: warning: argument unused during compilation: '-fast'
clang: warning: argument unused during compilation: '-fast'
[ 3%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_cp1251.c.o
clang: warning: argument unused during compilation: '-fast'
[ 3%] Building C object third-party/timelib/CMakeFiles/timelib.dir/tm2unixtime.c.o
[ 3%] clang: warning: argument unused during compilation: '-fast'
Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_ascii.c.o
clang: warning: argument unused during compilation: '-fast'
[ 3%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_iso8859_3.c.o
[ 3%] Building C object third-party/timelib/CMakeFiles/timelib.dir/unixtime2tm.c.o
clang: warning: argument unused during compilation: '-fast'
clang: warning: argument unused during compilation: '-fast'
[ 3%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_iso8859_4.c.o
clang: warning: argument unused during compilation: '-fast'
Linking C static library libtimelib.a
[ 3%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_iso8859_5.c.o
[ 3%] Built target timelib
[ 3%] clang: warning: argument unused during compilation: '-fast'
Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_iso8859_6.c.o
clang: warning: argument unused during compilation: '-fast'
[ 3%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_iso8859_7.c.o
clang: warning: argument unused during compilation: '-fast'
[ 3%] Linking C static library libsqlite3.a
Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_iso8859_8.c.o
clang: warning: argument unused during compilation: '-fast'
[ 3%] [ 3%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_iso8859_9.c.o
Built target sqlite3
[ 3%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_iso8859_10.c.o
[ 4%] clang: warning: argument unused during compilation: '-fast'
Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_iso8859_13.c.o
clang: warning: argument unused during compilation: '-fast'
clang: warning: argument unused during compilation: '-fast'
[ 4%] [ 4%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_iso8859_14.c.o
[ 4%] Building C object third-party/lz4/CMakeFiles/lz4.dir/lz4.c.o
Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_iso8859_15.c.o
clang: warning: argument unused during compilation: '-fast'
clang: warning: argument unused during compilation: '-fast'
clang: warning: argument unused during compilation: '-fast'
[ 4%] Building C object third-party/lz4/CMakeFiles/lz4.dir/lz4hc.c.o
[ 4%] clang: warning: argument unused during compilation: '-fast'
Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_iso8859_16.c.o
clang: warning: argument unused during compilation: '-fast'
[ 4%] Building CXX object third-party/double-conversion/CMakeFiles/double-conversion.dir/src/double-conversion.cc.o
[ 4%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_htmlent.c.o
Linking C static library liblz4.a
clang: warning: argument unused during compilation: '-fast'
[ 4%] Built target lz4
[ 4%] /path/to/hhvm/third-party/libmbfl/filters/mbfilter_htmlent.c:242:11: warning: implicitly declaring library function 'strcmp' with type 'int (const char *, const char *)'
if (!strcmp(buffer+1, entity->name)) {
^
/path/to/hhvm/third-party/libmbfl/filters/mbfilter_htmlent.c:242:11: note: please include the header or explicitly provide a declaration for 'strcmp'
/path/to/hhvm/third-party/libmbfl/filters/mbfilter_htmlent.c:265:9: warning: implicitly declaring library function 'strchr' with type 'char *(const char *, int)'
if (!strchr(html_entity_chars, c) || filter->status+1==html_enc_buffer_size || (c=='#' && filter->status>2))
^
/path/to/hhvm/third-party/libmbfl/filters/mbfilter_htmlent.c:265:9: note: please include the header or explicitly provide a declaration for 'strchr'
Building CXX object third-party/double-conversion/CMakeFiles/double-conversion.dir/src/strtod.cc.o
2 warnings generated.
[ 4%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_byte2.c.o
clang: warning: argument unused during compilation: '-fast'
[ 4%] [ 4%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_byte4.c.o
Building CXX object third-party/double-conversion/CMakeFiles/double-conversion.dir/src/bignum.cc.o
clang: warning: argument unused during compilation: '-fast'
[ 4%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_uuencode.c.o
[ 4%] clang: warning: argument unused during compilation: '-fast'
Building CXX object third-party/folly/CMakeFiles/folly.dir/folly/Range.cpp.o
[ 4%] Building CXX object third-party/double-conversion/CMakeFiles/double-conversion.dir/src/fixed-dtoa.cc.o
[ 4%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_base64.c.o
In file included from /path/to/hhvm/third-party/folly/folly/Range.cpp:20:
In file included from /path/to/hhvm/third-party/folly/folly/Range.h:23:
In file included from /path/to/hhvm/third-party/folly/folly/Portability.h:199:
In file included from /usr/include/boost/type_traits.hpp:13:
In file included from /usr/include/boost/type_traits/add_const.hpp:13:
In file included from /usr/include/boost/config.hpp:40:
/usr/include/boost/config/select_stdlib_config.hpp:18:12: fatal error: 'cstddef' file not found
# include
^
clang: warning: argument unused during compilation: '-fast'
[ 4%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_sjis.c.o
clang: warning: argument unused during compilation: '-fast'
[ 4%] Building CXX object third-party/double-conversion/CMakeFiles/double-conversion.dir/src/cached-powers.cc.o
/path/to/hhvm/third-party/double-conversion/src/cached-powers.cc:134:18: warning: unused variable 'kCachedPowersLength' [-Wunused-const-variable]
static const int kCachedPowersLength = ARRAY_SIZE(kCachedPowers);
^
1 warning generated.
[ 4%] Building CXX object third-party/double-conversion/CMakeFiles/double-conversion.dir/src/diy-fp.cc.o
[ 4%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_7bit.c.o
clang: warning: argument unused during compilation: '-fast'
[ 4%] [ 4%] Building CXX object third-party/double-conversion/CMakeFiles/double-conversion.dir/src/bignum-dtoa.cc.o
Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_qprint.c.o
clang: warning: argument unused during compilation: '-fast'
[ 4%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_ucs4.c.o
clang: warning: argument unused during compilation: '-fast'
[ 4%] Building CXX object third-party/double-conversion/CMakeFiles/double-conversion.dir/src/fast-dtoa.cc.o
[ 4%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_ucs2.c.o
clang: warning: argument unused during compilation: '-fast'
1 error generated.
third-party/folly/CMakeFiles/folly.dir/build.make:57: recipe for target 'third-party/folly/CMakeFiles/folly.dir/folly/Range.cpp.o' failed
make[2]: *** [third-party/folly/CMakeFiles/folly.dir/folly/Range.cpp.o] Error 1
CMakeFiles/Makefile2:471: recipe for target 'third-party/folly/CMakeFiles/folly.dir/all' failed
make[1]: *** [third-party/folly/CMakeFiles/folly.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 4%] [ 5%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_utf32.c.o
Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_utf16.c.o
clang: warning: argument unused during compilation: '-fast'
clang: warning: argument unused during compilation: '-fast'
Linking CXX static library libdouble-conversion.a
[ 5%] [ 5%] [ 5%] Built target double-conversion
Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_utf8.c.o
[ 5%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_utf7.c.o
Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_utf7imap.c.o
clang: warning: argument unused during compilation: '-fast'
clang: warning: argument unused during compilation: '-fast'
clang: warning: argument unused during compilation: '-fast'
[ 5%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_euc_jp_win.c.o
[ 5%] [ 5%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_cp932.c.o
Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_cp51932.c.o
clang: warning: argument unused during compilation: '-fast'
clang: warning: argument unused during compilation: '-fast'
clang: warning: argument unused during compilation: '-fast'
[ 5%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_euc_cn.c.o
[ 5%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_euc_kr.c.o
[ 5%] clang: warning: argument unused during compilation: '-fast'
Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_uhc.c.o
clang: warning: argument unused during compilation: '-fast'
clang: warning: argument unused during compilation: '-fast'
[ 5%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_iso2022_jp_ms.c.o
[ 5%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_iso2022_kr.c.o
clang: warning: argument unused during compilation: '-fast'
clang: warning: argument unused during compilation: '-fast'
[ 5%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_cp866.c.o
clang: warning: argument unused during compilation: '-fast'
[ 5%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_koi8r.c.o
clang: warning: argument unused during compilation: '-fast'
[ 5%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_koi8u.c.o
[ 5%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_armscii8.c.o
clang: warning: argument unused during compilation: '-fast'
clang: warning: argument unused during compilation: '-fast'
[ 6%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/mbfilter_cp850.c.o
[ 6%] [ 6%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/filters/html_entities.c.o
Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/nls/nls_ja.c.o
clang: warning: argument unused during compilation: '-fast'
clang: warning: argument unused during compilation: '-fast'
clang: warning: argument unused during compilation: '-fast'
[ 6%] [ 6%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/nls/nls_de.c.o
[ 6%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/nls/nls_en.c.o
Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/nls/nls_hy.c.o
clang: warning: argument unused during compilation: '-fast'
clang: warning: argument unused during compilation: '-fast'
clang: warning: argument unused during compilation: '-fast'
[ 6%] [ 6%] [ 6%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/nls/nls_kr.c.o
Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/nls/nls_tr.c.o
Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/nls/nls_ru.c.o
clang: warning: argument unused during compilation: '-fast'
clang: warning: argument unused during compilation: '-fast'
clang: warning: argument unused during compilation: '-fast'
[ 6%] [ 6%] [ 6%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/nls/nls_ua.c.o
Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/nls/nls_zh.c.o
Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/nls/nls_uni.c.o
clang: warning: argument unused during compilation: '-fast'
clang: warning: argument unused during compilation: '-fast'
clang: warning: argument unused during compilation: '-fast'
[ 6%] Building C object third-party/libmbfl/mbfl/CMakeFiles/mbfl.dir/__/nls/nls_neutral.c.o
clang: warning: argument unused during compilation: '-fast'
Linking C static library libmbfl.a
[ 6%] Built target mbfl
Makefile:116: recipe for target 'all' failed
make: *** [all] Error 2

real	0m4.388s
user	0m9.308s
sys	0m2.026s
~~~