RFR: 8353458: Don't pass -Wno-format-nonliteral to CFLAGS
Julian Waters
jwaters at openjdk.org
Wed Apr 2 08:03:32 UTC 2025
On Wed, 2 Apr 2025 02:00:39 GMT, David Holmes <dholmes at openjdk.org> wrote:
> > there was already a pragma but due to incorrect restrictions it did not apply to clang.
>
> How does the `__GNUC__` check affect clang?? Isn't that just for gcc?
clang has a tendency to like to pretend to be other compilers, it defines __GNUC__ in addition to __clang__ and even defines _MSC_VER if you're compiling for Windows. This is why it's common in code to see the #ifdef __clang__ be the very first ifdef when checking for a compiler; It has to be first, otherwise the check wouldn't work. If I had to guess, while clang defines __GNUC__ it doesn't define it to the version number like gcc does, which is why the > 5 check failed in clang's case here
-------------
PR Comment: https://git.openjdk.org/jdk/pull/24357#issuecomment-2771672196
More information about the build-dev
mailing list