GithubHelp home page GithubHelp logo

Comments (5)

mstorsjo avatar mstorsjo commented on August 15, 2024

Thanks for the report! I presume this is caused by mingw-w64/mingw-w64@1652e92.

A later patch that is part of a larger patch set, that still is in progress, should fix this. I’ll let you know when a fix is available.

from llvm-mingw.

mstorsjo avatar mstorsjo commented on August 15, 2024

@markus-oberhumer Headsup - when testing a fix for this issue, I noticed another recent regression on the main branch of Clang; you should be able to try it out with https://github.com/mstorsjo/llvm-mingw/releases/nightly. (I don't provide nightly builds targeting msvcrt, but this regression is unrelated to the CRT choice.)

llvm/llvm-project@29d447a and llvm/llvm-project#90676 changed so that each time <stddef.h> is included, it applies its contents. This seems to be somewhat intentional.

In upx, in compress_lzma.cpp, at https://github.com/upx/upx/blob/devel/src/compress/compress_lzma.cpp#L209-L218, there seems to be attempts to redefine NULL to nullptr. However, when including other later files, many of them (re)include <stddef.h>, which now will end up redefining NULL back to 0. This causes errors like these:

/home/martin/code/upx/vendor/lzma-sdk/C/7zip/Compress/LZMA/../../../Common/MyCom.h:84:26: error: zero as null pointer constant [-Werror,-Wzero-as-null-pointer-constant]                                             
   84 |   CMyComBSTR() { m_str = NULL; }
      |                          ^~~~                                   
      |                          nullptr
/home/martin/clang-nightly/lib/clang/19/include/__stddef_null.h:23:14: note:
 expanded from macro 'NULL'
   23 | #define NULL 0
      |              ^

from llvm-mingw.

markus-oberhumer avatar markus-oberhumer commented on August 15, 2024

@mstorsjo Thanks for that info!

As you have noticed this code is problematic for some other toolchains as well (I have never looked in detail why NULL gets redefined under certain circumstances), so I've now opted for the easy solution:

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"

from llvm-mingw.

mstorsjo avatar mstorsjo commented on August 15, 2024

This issue should hopefully have been fixed in the latest release, at https://github.com/mstorsjo/llvm-mingw/releases/tag/20240518.

from llvm-mingw.

markus-oberhumer avatar markus-oberhumer commented on August 15, 2024

Fixed in 20240518, many thanks!

from llvm-mingw.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.