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: |
|
Maintainer CC'd 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. what about this patch though? And more importantly, will supporting clang break it on gcc? This patch is very minimal, let's just apply it. It should not break with any version of gcc. 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. My apologies to Dimitry, I misunderstood that he already provided a fix. Sorry this took so long. 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 Assign to committer who resolved |
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.