Bug 208052 - devel/llvm38: wrong patch for ccc-analyzer causes a lot of warnings
Summary: devel/llvm38: wrong patch for ccc-analyzer causes a lot of warnings
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Brooks Davis
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-16 06:12 UTC by Aleksander Alekseev
Modified: 2016-04-19 18:22 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (brooks)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 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 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.