Skip to content

__GNUC__ 4, __GNUC_MINOR__ 2 and __GNUC_PATCHLEVEL__ 1 too old and not consistent than the macro __VERSION__ Clang 22.1.4 #555

Description

@forchid

In the GCC toolchain from MinGW-Builds project, these macros look correct and consistent, but these aren't in the llvm-mingw.

the test

cc\version>g++ -o gnu-version gccv.cc

cc\version>.\gnu-version
GNU Compiler Collection version: 15.2.0
Full version string: 15.2.0

cc\version>mingw-llvmenv
cc\version>g++ -o llvm-version gccv.cc

cc\version>.\llvm-version
GNU Compiler Collection version: 4.2.1
Full version string: Clang 22.1.4 (https://github.com/llvm/llvm-project.git 35990504507d79e0b9deb809c8ee5e1b34ceef20)

the source

#include <iostream>

int main() {
    std::cout << "GNU Compiler Collection version: ";
    std::cout << __GNUC__ << "." << __GNUC_MINOR__ << "." << __GNUC_PATCHLEVEL__ << std::endl;
    std::cout << "Full version string: " << __VERSION__ << std::endl;
    return 0;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions