[llvm-commits] [llvm] r161205 - in /llvm/trunk: CMakeLists.txt docs/yaml2obj.rst include/llvm/Support/COFF.h test/Object/COFF/ test/Object/COFF/i386.yaml test/Object/COFF/x86-64.yaml test/Object/Inputs/trivial-object-test.coff-i386 test/Object/nm

David Blaikie dblaikie at gmail.com
Thu Aug 9 14:36:23 PDT 2012


Just going to bump/+1 this since I noticed this on my buildbots too.

On Thu, Aug 2, 2012 at 5:40 PM, Dmitri Gribenko <gribozavr at gmail.com> wrote:
> On Thu, Aug 2, 2012 at 12:16 PM, Michael J. Spencer
> <bigcheesegs at gmail.com> wrote:
>> +              .Default(COFF::MT_Invalid);
>> +            if (Machine == COFF::MT_Invalid) {
>> +              YS.printError(Value, "Invalid value for Machine");
>> +              return false;
>> +            }
>
> GCC gives a bunch of warnings:
> /home/grib/clang-clean/llvm/utils/yaml2obj/yaml2obj.cpp: In member
> function ‘bool COFFParser::parseHeader(llvm::yaml::Node*)’:
> /home/grib/clang-clean/llvm/utils/yaml2obj/yaml2obj.cpp:199:34:
> warning: comparison is always false due to limited range of data type
> [-Wtype-limits]
> /home/grib/clang-clean/llvm/utils/yaml2obj/yaml2obj.cpp: In member
> function ‘bool COFFParser::parseSections(llvm::yaml::Node*)’:
> /home/grib/clang-clean/llvm/utils/yaml2obj/yaml2obj.cpp:485:43:
> warning: comparison is always false due to limited range of data type
> [-Wtype-limits]
> /home/grib/clang-clean/llvm/utils/yaml2obj/yaml2obj.cpp: In member
> function ‘bool COFFParser::parseSymbols(llvm::yaml::Node*)’:
> /home/grib/clang-clean/llvm/utils/yaml2obj/yaml2obj.cpp:644:48:
> warning: comparison is always false due to limited range of data type
> [-Wtype-limits]
> /home/grib/clang-clean/llvm/utils/yaml2obj/yaml2obj.cpp: In member
> function ‘bool COFFParser::parseHeader(llvm::yaml::Node*)’:
> /home/grib/clang-clean/llvm/utils/yaml2obj/yaml2obj.cpp:204:35:
> warning: ‘Machine’ may be used uninitialized in this function
> [-Wmaybe-uninitialized]
>
> Seems like you are storing -1 (MT_Invalid) to an uint16_t as
> StringSwitch default, -1 gets converted to 0xffff.  Then 0xffff is
> compared to -1 (MT_Invalid), and the comparison can never succeed.
>
> Dmitri
>
> --
> main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
> (j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list