From 49b2f341673deaf73b87a7943f9009da27f62cf8 Mon Sep 17 00:00:00 2001 From: Lysandros Nikolaou Date: Thu, 12 Oct 2023 11:12:32 +0200 Subject: [PATCH] gh-106212: Raise when using c-analyzer with clang on darwin --- Tools/c-analyzer/c_parser/preprocessor/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Tools/c-analyzer/c_parser/preprocessor/__init__.py b/Tools/c-analyzer/c_parser/preprocessor/__init__.py index cdc1a4e1269059..30a86cbd7dc494 100644 --- a/Tools/c-analyzer/c_parser/preprocessor/__init__.py +++ b/Tools/c-analyzer/c_parser/preprocessor/__init__.py @@ -2,6 +2,7 @@ import logging import os import os.path +import platform import re import sys @@ -242,6 +243,8 @@ def _get_default_compiler(): return 'unix' if os.name == 'nt': return 'msvc' + if sys.platform == 'darwin' and 'clang' in platform.python_compiler(): + return 'clang' return 'unix'