Bug 198009

Summary: Fix textproc/wordnet build with clang 3.6.0
Product: Ports & Packages Reporter: Dimitry Andric <dim>
Component: Individual Port(s)Assignee: Mikhail Teterin <mi>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 197395    
Attachments:
Description Flags
Use __DECONST to cast away const in getptrtype() none

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.