Bug 196124 - Fix lang/urweb build with clang 3.5.0
Summary: Fix lang/urweb build with clang 3.5.0
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: Koop Mast
URL:
Keywords:
Depends on:
Blocks: 195480
  Show dependency treegraph
 
Reported: 2014-12-19 13:26 UTC by Dimitry Andric
Modified: 2015-02-16 02:14 UTC (History)
2 users (show)

See Also:
koobs: maintainer-feedback+


Attachments
Fix lang/urweb build with clang 3.5.0 (958 bytes, patch)
2014-12-19 13:26 UTC, Dimitry Andric
no flags Details | Diff

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