Skip to content

[scan-build][Windows] Fix driver name transformation in scan-build #143135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 6, 2025

Conversation

kikairoya
Copy link
Contributor

On Windows system, scan-build resolves clang++ driver name as "clang-{ver}++.exe" from "clang-{ver}.exe" but should transform to "clang++.exe".

@llvmbot llvmbot added clang Clang issues not falling into any other category clang:static analyzer labels Jun 6, 2025
@kikairoya kikairoya changed the title [Clant-Tools][Windows] Fix driver name transformation in scan-build [Clang-Tools][Windows] Fix driver name transformation in scan-build Jun 6, 2025
On Windows system, scan-build resolves clang++ driver name as "clang-{ver}++.exe"
from "clang-{ver}.exe" but should transform to "clang++.exe".
@llvmbot
Copy link
Member

llvmbot commented Jun 6, 2025

@llvm/pr-subscribers-clang

@llvm/pr-subscribers-clang-static-analyzer-1

Author: Tomohiro Kashiwada (kikairoya)

Changes

On Windows system, scan-build resolves clang++ driver name as "clang-{ver}++.exe" from "clang-{ver}.exe" but should transform to "clang++.exe".


Full diff: https://github.com/llvm/llvm-project/pull/143135.diff

1 Files Affected:

  • (modified) clang/tools/scan-build/bin/scan-build (+1-1)
diff --git a/clang/tools/scan-build/bin/scan-build b/clang/tools/scan-build/bin/scan-build
index b90e635d31757..da7fe94cf4c03 100755
--- a/clang/tools/scan-build/bin/scan-build
+++ b/clang/tools/scan-build/bin/scan-build
@@ -1898,7 +1898,7 @@ if ($Clang !~ /\+\+(\.exe)?$/) {
   # Determine operating system under which this copy of Perl was built.
   my $IsWinBuild = ($^O =~/msys|cygwin|MSWin32/);
   if($IsWinBuild) {
-    $ClangCXX =~ s/.exe$/++.exe/;
+    $ClangCXX =~ s/\-\d+(\.\d+)?.exe$/++.exe/;
   }
   else {
     $ClangCXX =~ s/\-\d+(\.\d+)?$//;

@kikairoya kikairoya force-pushed the scanbuild-windows branch from 206a121 to 7d6d268 Compare June 6, 2025 13:16
Copy link
Contributor

@steakhal steakhal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've never used scan-build on Windows, but the patch looks harmless so let's fix this.

@steakhal steakhal merged commit b07a6da into llvm:main Jun 6, 2025
5 of 7 checks passed
@steakhal steakhal changed the title [Clang-Tools][Windows] Fix driver name transformation in scan-build [scan-build][Windows] Fix driver name transformation in scan-build Jun 6, 2025
@kikairoya kikairoya deleted the scanbuild-windows branch June 7, 2025 03:36
rorth pushed a commit to rorth/llvm-project that referenced this pull request Jun 11, 2025
…lvm#143135)

On Windows system, scan-build resolves clang++ driver name as
"clang-{ver}++.exe" from "clang-{ver}.exe" but should transform to
"clang++.exe".
DhruvSrivastavaX pushed a commit to DhruvSrivastavaX/lldb-for-aix that referenced this pull request Jun 12, 2025
…lvm#143135)

On Windows system, scan-build resolves clang++ driver name as
"clang-{ver}++.exe" from "clang-{ver}.exe" but should transform to
"clang++.exe".
tomtor pushed a commit to tomtor/llvm-project that referenced this pull request Jun 14, 2025
…lvm#143135)

On Windows system, scan-build resolves clang++ driver name as
"clang-{ver}++.exe" from "clang-{ver}.exe" but should transform to
"clang++.exe".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:static analyzer clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants