[LLVMdev] Dubious code in llvm/lib/MC/MachObjectWriter.cpp

Csaba Raduly rcsaba at gmail.com
Thu Jan 20 12:49:28 PST 2011


In llvm/lib/MC/MachObjectWriter.cpp, there's

    assert(OS.tell() - Start == is64Bit() ?
           macho::Header64Size : macho::Header32Size);

Shouldn't that be

    assert(OS.tell() - Start == (is64Bit() ?
           macho::Header64Size : macho::Header32Size));

MSVC emits a warning, and it doesn't seem right to compare a boolean
with a difference of two integers.

Csaba
-- 
GCS a+ e++ d- C++ ULS$ L+$ !E- W++ P+++$ w++$ tv+ b++ DI D++ 5++
Life is complex, with real and imaginary parts.
"Ok, it boots. Which means it must be bug-free and perfect. " -- Linus Torvalds
"People disagree with me. I just ignore them." -- Linus Torvalds
-------------- next part --------------
A non-text attachment was scrubbed...
Name: macho.diff
Type: application/octet-stream
Size: 913 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110120/113b3a2f/attachment.obj>


More information about the llvm-dev mailing list