Bug 198009 - Fix textproc/wordnet build with clang 3.6.0
Summary: Fix textproc/wordnet build with clang 3.6.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Mikhail Teterin
URL:
Keywords:
Depends on:
Blocks: 197395
  Show dependency treegraph
 
Reported: 2015-02-24 20:52 UTC by Dimitry Andric
Modified: 2015-02-25 00:57 UTC (History)
0 users

See Also:


Attachments
Use __DECONST to cast away const in getptrtype() (462 bytes, patch)
2015-02-24 20:52 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 2015-02-24 20:52:44 UTC
Created attachment 153469 [details]
Use __DECONST to cast away const in getptrtype()

During the exp-run in bug 197395, it was found that textproc/wordnet gives errors with clang 3.6.0:

http://package18.nyi.freebsd.org/data/headamd64PR197395-default/2015-02-11_23h04m51s/logs/errors/WordNet-3.0_2.log

I propose the following minimal fix, which changes the cast in getptrtype() in lib/wnutil.c to use __DECONST().
Comment 1 Mikhail Teterin freebsd_committer freebsd_triage 2015-02-25 00:21:17 UTC
Thank you, Dimitry, for the patch. Have you checked, whether the __DECONST() macro works with the older gcc compilers used by FreeBSD's earlier releases?
Comment 2 commit-hook freebsd_committer freebsd_triage 2015-02-25 00:56:07 UTC
A commit references this bug:

Author: mi
Date: Wed Feb 25 00:55:57 UTC 2015
New revision: 379859
URL: https://svnweb.freebsd.org/changeset/ports/379859

Log:
  Rephrase how we do the const-dropping casting so as to pass the muster
  of clang-3.6.0

  PR:		198009
  Submitted by:	dim

Changes:
  head/textproc/wordnet/files/patch-lib__wnutil.c
Comment 3 Mikhail Teterin freebsd_committer freebsd_triage 2015-02-25 00:57:01 UTC
Yes, the __DECONST construct works with gcc-4.2.1 as well. Thank you.