<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/130934>130934</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Warning in lld/COFF/Writer.cpp while building llvm
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            lld
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          anutosh491
      </td>
    </tr>
</table>

<pre>
    ```
│ │ $SRC_DIR/lld/COFF/Writer.cpp:1740:27: warning: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'long' [-Wsign-compare]
 │ │  1740 |   assert(coffHeaderOffset == buf - buffer->getBufferStart());
 │ │       |          ~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 │ │ $BUILD_PREFIX/opt/emsdk/upstream/emscripten/cache/sysroot/include/assert.h:8:28: note: expanded from macro 'assert'
 │ │     8 | #define assert(x) ((void)((x) || (__assert_fail(#x, __FILE__, __LINE__, __func__),0)))
 │ │       |                            ^
 │ │ $SRC_DIR/lld/COFF/Writer.cpp:788:7: note: in instantiation of function template specialization '(anonymous namespace)::Writer::writeHeader<llvm::object::pe32plus_header>' requested here
 │ │   788 |       writeHeader<pe32plus_header>();
 │ │       |       ^
 │ │ $SRC_DIR/lld/COFF/Writer.cpp:1773:25: warning: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'long' [-Wsign-compare]
 │ │  1773 |   assert(peHeaderOffset == buf - buffer->getBufferStart());
 │ │       |          ~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 │ │ $BUILD_PREFIX/opt/emsdk/upstream/emscripten/cache/sysroot/include/assert.h:8:28: note: expanded from macro 'assert'
 │ │     8 | #define assert(x) ((void)((x) || (__assert_fail(#x, __FILE__, __LINE__, __func__),0)))
 │ │       |                            ^
 │ │ $SRC_DIR/lld/COFF/Writer.cpp:1840:26: warning: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'long' [-Wsign-compare]
 │ │  1840 |          dataDirOffset64 == buf - buffer->getBufferStart());
 │ │       |          ~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 │ │ $BUILD_PREFIX/opt/emsdk/upstream/emscripten/cache/sysroot/include/assert.h:8:28: note: expanded from macro 'assert'
 │ │     8 | #define assert(x) ((void)((x) || (__assert_fail(#x, __FILE__, __LINE__, __func__),0)))
 │ │       |                            ^
 │ │ $SRC_DIR/lld/COFF/Writer.cpp:1740:27: warning: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'long' [-Wsign-compare]
 │ │  1740 |   assert(coffHeaderOffset == buf - buffer->getBufferStart());
 │ │       |          ~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 │ │ $BUILD_PREFIX/opt/emsdk/upstream/emscripten/cache/sysroot/include/assert.h:8:28: note: expanded from macro 'assert'
 │ │     8 | #define assert(x) ((void)((x) || (__assert_fail(#x, __FILE__, __LINE__, __func__),0)))
 │ │       |                            ^
 │ │ $SRC_DIR/lld/COFF/Writer.cpp:790:7: note: in instantiation of function template specialization '(anonymous namespace)::Writer::writeHeader<llvm::object::pe32_header>' requested here
 │ │   790 |       writeHeader<pe32_header>();
 │ │       |       ^
 │ │ $SRC_DIR/lld/COFF/Writer.cpp:1773:25: warning: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'long' [-Wsign-compare]
 │ │  1773 |   assert(peHeaderOffset == buf - buffer->getBufferStart());
 │ │       |          ~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 │ │ $BUILD_PREFIX/opt/emsdk/upstream/emscripten/cache/sysroot/include/assert.h:8:28: note: expanded from macro 'assert'
 │ │     8 | #define assert(x) ((void)((x) || (__assert_fail(#x, __FILE__, __LINE__, __func__),0)))
 │ │       |                            ^
 │ │ $SRC_DIR/lld/COFF/Writer.cpp:1840:26: warning: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'long' [-Wsign-compare]
 │ │  1840 |          dataDirOffset64 == buf - buffer->getBufferStart());
 │ │       |          ~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 │ │ $BUILD_PREFIX/opt/emsdk/upstream/emscripten/cache/sysroot/include/assert.h:8:28: note: expanded from macro 'assert'
 │ │     8 | #define assert(x) ((void)((x) || (__assert_fail(#x, __FILE__, __LINE__, __func__),0)))
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzsWN2PozYQ_2smL1YisGENDzxkk6BGWvWqPVXbN-TgIXEPbGqb_ehD__bKkNvb-9jVXSu1tzpGCCaT8Qe_8W9mhHBOHTViAeklpNuFGPzJ2ELowRt3SvJ4cTDyoYCL6HxFa9hRyBPIKHmi0eTt9aba7q-Blm0rgZabN2UJtLyxyqNd1X0PbB3zJAK2phzYmtwJq5U-BrU2XS-sckYT0xClPR7RuqBL1TRoUXsS9umCM1A-KO0ZrTxQToBm4p0YrXp8FxkmAMqB5kRoGf5pjT6Ovunl8iY4LacVEdItRGvypVciYbME-IYQIpxD64FmtWman1BItG-axqEnwLbAtuQwNGQZ7g3aJbDdEf3l-OOtF-NAoHm42OWzy40yLXeWvz4RAunuc-vH8tz0QJPLX_dX2-qX6125_w1oaXoPtMTOyXdAy6F33qLoJlNtVe9RAy1rUZ8QaOkenDUmjFC6bgcZbBMqqxOwdRaiGm5EG4_hife90BIlaazpSCdqa0Ik3iPJX8IhG3EAyiQ2SuMH-O9DTEc0s1uj5Ahq9mjnm2lYVlXTiKoRqh092D3QDamqcn-1q6pJv9r__Kg3g66DngPdROdY0fwbYvW5QLp7IRhfwxaeBUT5U1SVJko7L7RXwquJLmHvo-6x61vhkbgeayVa9efkM3IhE9roh84MjmjRoetFjeOJXANbT8tO-l3QpzMObNO2t91k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