<div dir="ltr">Yeah it doesn't like that the element type for the array is unnamed. I just reverted in 186305.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Jul 14, 2013 at 10:43 PM, Serge Pavlov <span dir="ltr"><<a href="mailto:sepavloff@gmail.com" target="_blank">sepavloff@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">gcc 4.6.3 also cannot build trunk.<div><br></div><div>--Serge</div></div><div class="gmail_extra"><div><div class="h5">
<br><br><div class="gmail_quote">2013/7/15 Hal Finkel <span dir="ltr"><<a href="mailto:hfinkel@anl.gov" target="_blank">hfinkel@anl.gov</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">----- Original Message -----<br>
> Author: ctopper<br>
> Date: Sun Jul 14 23:28:48 2013<br>
> New Revision: 186302<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=186302&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=186302&view=rev</a><br>
> Log:<br>
> Use llvm::array_lengthof to replace sizeof(array)/sizeof(array[0]).<br>
><br>
> Modified:<br>
> cfe/trunk/tools/driver/driver.cpp<br>
<br>
FWIW, this seems to break compilation with gcc 4.4.7:<br>
<br>
llvm-trunk/tools/clang/tools/driver/driver.cpp: In function ‘void ParseProgName(llvm::SmallVectorImpl<const char*>&, std::set<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&, clang::driver::Driver&)’:<br>
<br>
/llvm-trunk/tools/clang/tools/driver/driver.cpp:306: error: no matching function for call to ‘array_lengthof(const ParseProgName(llvm::SmallVectorImpl<const char*>&, std::set<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&, clang::driver::Driver&)::<anonymous struct> [10])’<br>
make[4]: *** [/llvm-trunk-build/tools/clang/tools/driver/Release+Asserts/driver.o] Error 1<br>
<br>
-Hal<br>
<br>
><br>
> Modified: cfe/trunk/tools/driver/driver.cpp<br>
> URL:<br>
> <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/driver.cpp?rev=186302&r1=186301&r2=186302&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/driver.cpp?rev=186302&r1=186301&r2=186302&view=diff</a><br>
> ==============================================================================<br>
> --- cfe/trunk/tools/driver/driver.cpp (original)<br>
> +++ cfe/trunk/tools/driver/driver.cpp Sun Jul 14 23:28:48 2013<br>
> @@ -25,6 +25,7 @@<br>
> #include "llvm/ADT/OwningPtr.h"<br>
> #include "llvm/ADT/SmallString.h"<br>
> #include "llvm/ADT/SmallVector.h"<br>
> +#include "llvm/ADT/STLExtras.h"<br>
> #include "llvm/Option/ArgList.h"<br>
> #include "llvm/Option/OptTable.h"<br>
> #include "llvm/Option/Option.h"<br>
> @@ -302,7 +303,7 @@ static void ParseProgName(SmallVectorImp<br>
> bool FoundMatch = false;<br>
> size_t i;<br>
><br>
> - for (i = 0; i < sizeof(suffixes) / sizeof(suffixes[0]); ++i) {<br>
> + for (i = 0; i < llvm::array_lengthof(suffixes); ++i) {<br>
> if (ProgNameRef.endswith(suffixes[i].Suffix)) {<br>
> FoundMatch = true;<br>
> if (suffixes[i].IsCXX)<br>
><br>
><br>
> _______________________________________________<br>
> cfe-commits mailing list<br>
> <a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
><br>
<span><font color="#888888"><br>
--<br>
Hal Finkel<br>
Assistant Computational Scientist<br>
Leadership Computing Facility<br>
Argonne National Laboratory<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br></div></div>Thanks,<br>--Serge<br>
</div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>~Craig
</div>