[llvm-commits] [lld] Fix some warnings

Joerg Sonnenberger joerg at britannica.bec.de
Wed Apr 25 17:05:17 PDT 2012


On Wed, Apr 25, 2012 at 02:41:03PM -0500, Evandro Menezes wrote:
> I noticed that LLD builds mostly cleanly, except for a some
> warnings, which this proposed patch aims to fix.
> 
> OK to commit?

What GCC flags and language settings are you using? Take it the majority
of those are about comma at the end of enums, which IIRC is legal now?

> Index: lib/Platforms/Darwin/ExecutableWriter.cpp
> ===================================================================
> --- lib/Platforms/Darwin/ExecutableWriter.cpp	(revision 155577)
> +++ lib/Platforms/Darwin/ExecutableWriter.cpp	(working copy)
> @@ -1219,7 +1219,7 @@ void SymbolStringsChunk::computeSize(const lld::Fi
>  uint32_t SymbolStringsChunk::stringIndex(StringRef str) {
>    uint32_t result = _strings.size();
>    const char* s = str.data();
> -  for (int i=0; i < str.size(); ++i) {
> +  for (unsigned int i=0; i < str.size(); ++i) {
>      _strings.push_back(s[i]);
>    }
>    _strings.push_back('\0');

This should be size_t or StringRef::size_type.

Joerg



More information about the llvm-commits mailing list