Bug 196124

Summary: Fix lang/urweb build with clang 3.5.0
Product: Ports & Packages Reporter: Dimitry Andric <dim>
Component: Individual Port(s)Assignee: Koop Mast <kwm>
Status: Closed FIXED    
Severity: Affects Many People CC: beyert, kwm
Priority: --- Flags: koobs: maintainer-feedback+
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 195480    
Attachments:
Description Flags
Fix lang/urweb build with clang 3.5.0 none

Description Dimitry Andric freebsd_committer freebsd_triage 2014-12-19 13:26:04 UTC
Created attachment 150761 [details]
Fix lang/urweb build with clang 3.5.0

The lang/urweb port fails to compile with clang 3.5.0, due to the following -Werror warning:

urweb.c:4207:12: error: absolute value function 'abs' given an argument of type 'uw_Basis_int' (aka 'long long') but has parameter of type 'int' which may cause truncation of value [-Werror,-Wabsolute-value]
    return abs(ret);
           ^
urweb.c:4207:12: note: use function 'llabs' instead
    return abs(ret);
           ^~~
           llabs

In this case the fix is to do as clang suggests: both the type of 'ret' and the return type of the function are 'long long', so llabs() should be used.
Comment 1 Bugzilla Automation freebsd_committer freebsd_triage 2014-12-19 13:26:04 UTC
Maintainer CC'd
Comment 2 Timothy Beyer 2014-12-20 01:58:46 UTC
A long time ago I wrote a custom patch to get it working with clang, but I don't recall if I ever added to the port.

I'll look into getting clang working with all of my ports.
Comment 3 John Marino freebsd_committer freebsd_triage 2015-02-06 17:26:22 UTC
what about this patch though?
And more importantly, will supporting clang break it on gcc?
Comment 4 Dimitry Andric freebsd_committer freebsd_triage 2015-02-06 22:07:10 UTC
This patch is very minimal, let's just apply it.  It should not break with any version of gcc.
Comment 5 Timothy Beyer 2015-02-07 21:58:12 UTC
Sorry about the delay.  Yes, please apply the patch.

I am going to submit an update to a much newer version of Ur/Web very soon, and I will incorporate that patch into my submission if necessary.

I'll talk to the Ur/Web developers if there is anything that should be committed upstream.
Comment 6 Timothy Beyer 2015-02-07 22:00:21 UTC
My apologies to Dimitry, I misunderstood that he already provided a fix.

Sorry this took so long.
Comment 7 commit-hook freebsd_committer freebsd_triage 2015-02-14 13:58:52 UTC
A commit references this bug:

Author: kwm
Date: Sat Feb 14 13:58:07 UTC 2015
New revision: 378962
URL: https://svnweb.freebsd.org/changeset/ports/378962

Log:
  Fix the build with clang 3.5 by using the suggested function.

  PR:		196124
  Submitted by:	dim@
  Approved by:	maintainer

Changes:
  head/lang/urweb/files/
  head/lang/urweb/files/patch-src__c__urweb.c
Comment 8 Kubilay Kocak freebsd_committer freebsd_triage 2015-02-16 02:14:33 UTC
Assign to committer who resolved