Bug 208052

Summary: devel/llvm38: wrong patch for ccc-analyzer causes a lot of warnings
Product: Ports & Packages Reporter: Aleksander Alekseev <afiskon>
Component: Individual Port(s)Assignee: Brooks Davis <brooks>
Status: Closed FIXED    
Severity: Affects Many People Flags: bugzilla: maintainer-feedback? (brooks)
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=207065

Description Aleksander Alekseev 2016-03-16 06:12:16 UTC
$ cat files/clang-patch-tools_clang_tools_scan-build_libexec_ccc-analyzer

$FreeBSD$

--- tools/clang/tools/scan-build/libexec/ccc-analyzer.orig
+++ tools/clang/tools/scan-build/libexec/ccc-analyzer
@@ -81,6 +81,9 @@
   if (-x "/usr/bin/xcrun") {
     $UseXCRUN = 1;
   }
+} elsif (`uname -s` == "FreeBSD") {
+  $DefaultCCompiler = 'cc';
+  $DefaultCXXCompiler = 'c++';
 } else {
   $DefaultCCompiler = 'gcc';
   $DefaultCXXCompiler = 'g++';

With this patch running scan-build gives a lot of warnings like this:

```
Argument "FreeBSD" isn't numeric in numeric eq (==)
at /usr/local/llvm38/bin/../libexec/ccc-analyzer line 84.

Argument "FreeBSD\n" isn't numeric in numeric eq (==)
at /usr/local/llvm38/bin/../libexec/ccc-analyzer line 84.
```

Besides newline character is missing in "FreeBSD" string. So it should be actually:

elsif(`uname -s` eq "FreeBSD\n")
Comment 1 Pedro F. Giffuni freebsd_committer freebsd_triage 2016-03-18 14:56:03 UTC
This seems related to the fix for PR 207065 (but doesn't apply to the original fix).
Comment 2 commit-hook freebsd_committer freebsd_triage 2016-03-18 21:15:49 UTC
A commit references this bug:

Author: brooks
Date: Fri Mar 18 21:15:28 UTC 2016
New revision: 411371
URL: https://svnweb.freebsd.org/changeset/ports/411371

Log:
  Use more correct perl in ccc-analyzer.

  PR:		208052, 20706
  Submitted by:	Aleksander Alekseev <afiskon@devzen.ru>

Changes:
  head/devel/llvm38/Makefile
  head/devel/llvm38/files/clang-patch-tools_clang_tools_scan-build_libexec_ccc-analyzer
Comment 3 Aleksander Alekseev 2016-04-19 18:21:42 UTC
I believe this issue is fixed.