Bug 190711 - editors/emacs with CANNA enabled fails to compile on FreeBSD 10.0, using clang
editors/emacs with CANNA enabled fails to compile on FreeBSD 10.0, using clang
Status: Closed FIXED
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s)
Latest
Any Any
: --- Affects Many People
Assigned To: Ashish SHUKLA
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-06-06 12:41 UTC by Nobuyoshi SATO
Modified: 2014-06-17 02:42 UTC (History)
0 users

See Also:


Attachments
A patch file for emacs-24.3/src/canna.c, and should be contianed as a part of ports patch files (672 bytes, text/plain)
2014-06-06 12:41 UTC, Nobuyoshi SATO
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nobuyoshi SATO 2014-06-06 12:41:56 UTC
Created attachment 143453 [details]
A patch file for emacs-24.3/src/canna.c, and should be contianed as a part of ports patch files

Canna (Japanese kana-kanji conversion engine) support enabled editors/emacs
port fails to compile on FreeBSD 10.0. Perhaps this will cause on 
editors/emacs23. This error seem to be a side-effect using clang.

The compile error is as follows:

canna.c:1583:17: error: non-void function 'count_char' should return a value
      [-Wreturn-type]
  if (len == 0) return;


To fix this problem, change declaration count_char() in canna.c from
static count_char(....) to static void count_char(....). The canna.c 
is created by emacs24.3canna-20130321.diff.gz which is a part of 
distfile. Change is as following:

--- src/canna.c.orig    2014-06-06 21:28:39.576576921 +0900
+++ src/canna.c 2014-06-06 21:29:46.141572668 +0900
@@ -191,7 +191,7 @@
 #if __STDC__
 static Lisp_Object mule_make_string(unsigned char *, int);
 static mule_strlen(unsigned char *, int);
-static count_char(unsigned char *,int, int, int, int *, int *, int *);
+static void count_char(unsigned char *,int, int, int, int *, int *, int *);
 #else /* __STDC__ */
 static Lisp_Object mule_make_string();
 static mule_strlen();
@@ -1573,6 +1573,9 @@

 /* count number of characters */
 static
+#if __STDC__
+void
+#endif
 count_char(p,len,pos,rev,clen,cpos,crev)
 unsigned char *p;
 int len,pos,rev,*clen,*cpos,*crev;

Also, I attach this patch for editors/emacs/files/patch-src_canna.c
Comment 1 Mark Linimon freebsd_committer 2014-06-13 03:14:06 UTC
Over to maintainer.
Comment 2 commit-hook freebsd_committer 2014-06-17 02:38:43 UTC
A commit references this bug:

Author: ashish
Date: Tue Jun 17 02:38:14 UTC 2014
New revision: 358066
URL: http://svnweb.freebsd.org/changeset/ports/358066

Log:
  - Fix building on 10.x when CANNA option is enabled, by updating CANNA
    patchset

  PR:				190711
  Submitted by:	Noboyoshi SATO <nobu-s at iwate-pu.ac.jp>

Changes:
  head/editors/emacs/Makefile
  head/editors/emacs/distinfo
Comment 3 Ashish SHUKLA freebsd_committer 2014-06-17 02:42:24 UTC
Thanks for you submission. I've updated the CANNA patchset to include the provided diff.

Thanks to Yuji TAKANO-san (maintainer of CANNA patchset) for testing the diff.