[MacPorts] #61147: xournal @0.4.8.2016_1: build failure with recent clang on Catalina

MacPorts noreply at macports.org
Tue Sep 8 21:10:16 UTC 2020


#61147: xournal @0.4.8.2016_1: build failure with recent clang on Catalina
--------------------------------+---------------------
 Reporter:  mzucker             |      Owner:  (none)
     Type:  defect              |     Status:  new
 Priority:  Normal              |  Milestone:
Component:  ports               |    Version:  2.6.3
 Keywords:  catalina, haspatch  |       Port:  xournal
--------------------------------+---------------------
 Apparently the xournal source code makes liberal use of undeclared
 functions, which are errors with an up-to date macOS and Clang. The build
 halts on an error when it encounters undeclared functions in the source.
 Here's a relevant log snippet:


 {{{
 :info:build sft.c:742:33: warning: cast to 'void *' from smaller integer
 type 'int' [-Wint-to-void-pointer-cast]
 :info:build         if (listFind(glyphlist, (void *) (int) index)) {
 :info:build                                 ^
 :info:build sft.c:756:31: warning: cast to 'void *' from smaller integer
 type 'int' [-Wint-to-void-pointer-cast]
 :info:build         listAppend(glyphlist, (void *) (int) index);
 :info:build                               ^
 :info:build ttcr.c:420:9: error: implicit declaration of function 'write'
 is invalid in C99 [-Werror,-Wimplicit-function-declaration]
 :info:build     if (write(fd, ptr, length) != length) {
 :info:build         ^
 :info:build ttcr.c:420:9: note: did you mean 'fwrite'?
 :info:build
 /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/stdio.h:165:9:
 note: 'fwrite' declared here
 :info:build sft.c:940:35: warning: cast to 'void *' from smaller integer
 type 'guint32' (aka 'unsigned int') [-Wint-to-void-pointer-cast]
 :info:build size_t   fwrite(const void * __restrict __ptr, size_t __size,
 size_t __nitems, FILE * __restrict __stream) __DARWIN_ALIAS(fwrite);
 :info:build             listAppend(glyphlist, (void *) glyphID);
 :info:build                                   ^
 :info:build          ^
 :info:build ttcr.c:426:5: error: implicit declaration of function 'close'
 is invalid in C99 [-Werror,-Wimplicit-function-declaration]
 :info:build     close(fd);
 :info:build     ^
 :info:build sft.c:1633:13: error: implicit declaration of function 'read'
 is invalid in C99 [-Werror,-Wimplicit-function-declaration]
 :info:build         if (read(fd, buffer, 12) == 12) {
 :info:build             ^
 :info:build sft.c:1633:13: note: did you mean 'fread'?
 :info:build
 /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/stdio.h:158:9:
 note: 'fread' declared here
 :info:build size_t   fread(void * __restrict __ptr, size_t __size, size_t
 __nitems, FILE * __restrict __stream);
 :info:build          ^
 :info:build sft.c:1637:9: error: implicit declaration of function 'close'
 is invalid in C99 [-Werror,-Wimplicit-function-declaration]
 :info:build         close(fd);
 :info:build         ^
 :info:build sft.c:1806:19: error: implicit declaration of function 'close'
 is invalid in C99 [-Werror,-Wimplicit-function-declaration]
 :info:build     if (fd != -1) close(fd);
 :info:build                   ^
 :info:build sft.c:1847:27: warning: cast to 'void *' from smaller integer
 type 'guint32' (aka 'unsigned int') [-Wint-to-void-pointer-cast]
 :info:build     listAppend(glyphlist, (void *) glyphID);
 }}}

 Adding the line
 {{{
 configure.cflags-append "-std=gnu89 -Wno-implicit-function-declaration"
 }}}
 to the Portfile allows xournal to build successfully.

 I will attach a patched Portfile if I can figure out how...

-- 
Ticket URL: <https://trac.macports.org/ticket/61147>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list