summaryrefslogtreecommitdiffstats
path: root/Tools/c-analyzer
diff options
context:
space:
mode:
authorLysandros Nikolaou <lisandrosnik@gmail.com>2023-10-13 08:52:30 (GMT)
committerGitHub <noreply@github.com>2023-10-13 08:52:30 (GMT)
commit898f531996f2c5399b13811682c578c4fd08afaa (patch)
tree3e29334cc9bfba7c66b732e1c4aaf8c713fa2ac4 /Tools/c-analyzer
parentb7f9661bc12fdfec98684c89f03177ae5d3d74c1 (diff)
downloadcpython-898f531996f2c5399b13811682c578c4fd08afaa.zip
cpython-898f531996f2c5399b13811682c578c4fd08afaa.tar.gz
cpython-898f531996f2c5399b13811682c578c4fd08afaa.tar.bz2
gh-106212: Raise when using c-analyzer with clang on darwin (#110757)
Diffstat (limited to 'Tools/c-analyzer')
-rw-r--r--Tools/c-analyzer/c_parser/preprocessor/__init__.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Tools/c-analyzer/c_parser/preprocessor/__init__.py b/Tools/c-analyzer/c_parser/preprocessor/__init__.py
index cdc1a4e..30a86cb 100644
--- a/Tools/c-analyzer/c_parser/preprocessor/__init__.py
+++ b/Tools/c-analyzer/c_parser/preprocessor/__init__.py
@@ -2,6 +2,7 @@ import contextlib
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'