Skip to content

Compiler is missing self macro versioning #21509

@dvrogozh

Description

@dvrogozh

With:

  • e66b3c3 (top of sycl branch) or v6.3.0

Please, provide macro definitions to:

  1. Differentiate intel/llvm compiler on C/C++ level from CLANG and ICX:
  2. Differentiate intel/llvm own releases (such as 6.2.0 vs. 6.3.0)

At the moment when compiling user gets only original clang versioning:

$ ./build/install/bin/clang-23 -fsycl -dM -E -x c++ /dev/null | grep clang
#define __clang__ 1
#define __clang_major__ 23
#define __clang_minor__ 0
#define __clang_patchlevel__ 0
#define __clang_version__ "23.0.0git (https://github.com/intel/llvm.git e66b3c331f5f64b7a9b300578eb884a5b20ba52e)"

$ ./build/install/bin/clang-23 -fsycl -dM -E -x c++ /dev/null | grep -i version
#define SYCL_LANGUAGE_VERSION 202012L
#define __GXX_ABI_VERSION 1002
#define __VERSION__ "Clang 23.0.0git (https://github.com/intel/llvm.git e66b3c331f5f64b7a9b300578eb884a5b20ba52e)"
#define __clang_version__ "23.0.0git (https://github.com/intel/llvm.git e66b3c331f5f64b7a9b300578eb884a5b20ba52e)"

Please, consider to implement something simple and straightforward aligned with the rest of compilers such as:

#if defined(__clang__)
    /* Clang-specific code */
#elif defined(__GNUC__)
    /* GCC-specific code (Clang is already ruled out) */
#elif defined(_MSC_VER)
    /* MSVC-specific code (Note: Clang-cl also defines this) */
#endif

CC: @tahonermann @sarnex @frenchwr

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions