b***@artifex.com
2017-11-26 16:18:54 UTC
http://bugs.ghostscript.com/show_bug.cgi?id=698782
Bug ID: 698782
Summary: fz_fopen_utf8() not declared when compiling under
MinGW
Product: MuPDF
Version: master
Hardware: PC
OS: Windows 7
Status: UNCONFIRMED
Severity: normal
Priority: P4
Component: fitz
Assignee: mupdf-***@artifex.com
Reporter: ***@gmail.com
QA Contact: gs-***@ghostscript.com
Word Size: ---
When I extract the source from mupdf-1.12-rc1-source.tar.gz (which happens to
represent the tip of master, at the moment), and run, under MinGW (of
mingw.org):
make HAVE_GLUT=no
I get:
[...]
source/fitz/output.c: In function 'fz_new_output_with_path':
source/fitz/output.c:196:7: warning: implicit declaration of function
'fz_remove_utf8' [-Wimplicit-function-declaration]
if (fz_remove_utf8(filename) < 0)
^~~~~~~~~~~~~~
source/fitz/output.c:200:9: warning: implicit declaration of function
'fz_fopen_utf8' [-Wimplicit-function-declaration]
file = fz_fopen_utf8(filename, append ? "ab" : "wb");
^~~~~~~~~~~~~
source/fitz/output.c:200:7: warning: assignment makes pointer from integer
without a cast [-Wint-conversion]
file = fz_fopen_utf8(filename, append ? "ab" : "wb");
^
[...]
CC build/release/source/fitz/stream-open.o
source/fitz/stream-open.c: In function 'fz_file_exists':
source/fitz/stream-open.c:18:9: warning: implicit declaration of function
'fz_fopen_utf8' [-Wimplicit-function-declaration]
file = fz_fopen_utf8(path, "rb");
^~~~~~~~~~~~~
source/fitz/stream-open.c:18:7: warning: assignment makes pointer from
integer without a cast [-Wint-conversion]
file = fz_fopen_utf8(path, "rb");
^
[...]
source/fitz/stream-open.c: In function 'fz_open_file':
source/fitz/stream-open.c:152:7: warning: assignment makes pointer from
integer without a cast [-Wint-conversion]
file = fz_fopen_utf8(name, "rb");
^
CC build/release/source/fitz/stream-prog.o
source/fitz/stream-prog.c: In function 'fz_open_file_progressive':
source/fitz/stream-prog.c:141:6: warning: implicit declaration of function
'fz_fopen_utf8' [-Wimplicit-function-declaration]
f = fz_fopen_utf8(name, "rb");
^~~~~~~~~~~~~
source/fitz/stream-prog.c:141:4: warning: assignment makes pointer from
integer without a cast [-Wint-conversion]
f = fz_fopen_utf8(name, "rb");
^
[...]
scripts/../source/fitz/output.c: In function 'fz_new_output_with_path':
scripts/../source/fitz/output.c:196:7: warning: implicit declaration of
function 'fz_remove_utf8' [-Wimplicit-function-declaration]
if (fz_remove_utf8(filename) < 0)
^~~~~~~~~~~~~~
scripts/../source/fitz/output.c:200:9: warning: implicit declaration of
function 'fz_fopen_utf8' [-Wimplicit-function-declaration]
file = fz_fopen_utf8(filename, append ? "ab" : "wb");
^~~~~~~~~~~~~
scripts/../source/fitz/output.c:200:7: warning: assignment makes pointer
from integer without a cast [-Wint-conversion]
file = fz_fopen_utf8(filename, append ? "ab" : "wb");
^
In file included from scripts/cmapdump.c:26:0:
scripts/../source/fitz/stream-open.c: In function 'fz_file_exists':
scripts/../source/fitz/stream-open.c:18:7: warning: assignment makes
pointer from integer without a cast [-Wint-conversion]
file = fz_fopen_utf8(path, "rb");
^
scripts/../source/fitz/stream-open.c: In function 'fz_open_file':
scripts/../source/fitz/stream-open.c:152:7: warning: assignment makes
pointer from integer without a cast [-Wint-conversion]
file = fz_fopen_utf8(name, "rb");
^
In file included from scripts/cmapdump.c:32:0:
scripts/../source/fitz/time.c: At top level:
scripts/../source/fitz/time.c:85:1: error: conflicting types for
'fz_fopen_utf8'
fz_fopen_utf8(const char *name, const char *mode)
^~~~~~~~~~~~~
In file included from scripts/cmapdump.c:22:0:
scripts/../source/fitz/output.c:200:9: note: previous implicit declaration
of 'fz_fopen_utf8' was here
file = fz_fopen_utf8(filename, append ? "ab" : "wb");
^~~~~~~~~~~~~
make: *** [build/release/scripts/cmapdump.o] Error 1
and the build stops.
The problem seems to be, that although fz_fopen_utf8() is implemented (in
source/fitz/time.c) for all Win32 targets, it is only declared (in
include/mupdf/fitz/system.h) for MSVC targets.
A solution would be to move fz_fopen_utf8() from the '#ifdef _MSC_VER' block to
an '#ifdef _WIN32' (like it's implementation is in source/fitz/time.c). Maybe
while we're at it, also move the declarations for the other functions
implemented for Win32 in source/fitz/time.c, as well.
Bug ID: 698782
Summary: fz_fopen_utf8() not declared when compiling under
MinGW
Product: MuPDF
Version: master
Hardware: PC
OS: Windows 7
Status: UNCONFIRMED
Severity: normal
Priority: P4
Component: fitz
Assignee: mupdf-***@artifex.com
Reporter: ***@gmail.com
QA Contact: gs-***@ghostscript.com
Word Size: ---
When I extract the source from mupdf-1.12-rc1-source.tar.gz (which happens to
represent the tip of master, at the moment), and run, under MinGW (of
mingw.org):
make HAVE_GLUT=no
I get:
[...]
source/fitz/output.c: In function 'fz_new_output_with_path':
source/fitz/output.c:196:7: warning: implicit declaration of function
'fz_remove_utf8' [-Wimplicit-function-declaration]
if (fz_remove_utf8(filename) < 0)
^~~~~~~~~~~~~~
source/fitz/output.c:200:9: warning: implicit declaration of function
'fz_fopen_utf8' [-Wimplicit-function-declaration]
file = fz_fopen_utf8(filename, append ? "ab" : "wb");
^~~~~~~~~~~~~
source/fitz/output.c:200:7: warning: assignment makes pointer from integer
without a cast [-Wint-conversion]
file = fz_fopen_utf8(filename, append ? "ab" : "wb");
^
[...]
CC build/release/source/fitz/stream-open.o
source/fitz/stream-open.c: In function 'fz_file_exists':
source/fitz/stream-open.c:18:9: warning: implicit declaration of function
'fz_fopen_utf8' [-Wimplicit-function-declaration]
file = fz_fopen_utf8(path, "rb");
^~~~~~~~~~~~~
source/fitz/stream-open.c:18:7: warning: assignment makes pointer from
integer without a cast [-Wint-conversion]
file = fz_fopen_utf8(path, "rb");
^
[...]
source/fitz/stream-open.c: In function 'fz_open_file':
source/fitz/stream-open.c:152:7: warning: assignment makes pointer from
integer without a cast [-Wint-conversion]
file = fz_fopen_utf8(name, "rb");
^
CC build/release/source/fitz/stream-prog.o
source/fitz/stream-prog.c: In function 'fz_open_file_progressive':
source/fitz/stream-prog.c:141:6: warning: implicit declaration of function
'fz_fopen_utf8' [-Wimplicit-function-declaration]
f = fz_fopen_utf8(name, "rb");
^~~~~~~~~~~~~
source/fitz/stream-prog.c:141:4: warning: assignment makes pointer from
integer without a cast [-Wint-conversion]
f = fz_fopen_utf8(name, "rb");
^
[...]
scripts/../source/fitz/output.c: In function 'fz_new_output_with_path':
scripts/../source/fitz/output.c:196:7: warning: implicit declaration of
function 'fz_remove_utf8' [-Wimplicit-function-declaration]
if (fz_remove_utf8(filename) < 0)
^~~~~~~~~~~~~~
scripts/../source/fitz/output.c:200:9: warning: implicit declaration of
function 'fz_fopen_utf8' [-Wimplicit-function-declaration]
file = fz_fopen_utf8(filename, append ? "ab" : "wb");
^~~~~~~~~~~~~
scripts/../source/fitz/output.c:200:7: warning: assignment makes pointer
from integer without a cast [-Wint-conversion]
file = fz_fopen_utf8(filename, append ? "ab" : "wb");
^
In file included from scripts/cmapdump.c:26:0:
scripts/../source/fitz/stream-open.c: In function 'fz_file_exists':
scripts/../source/fitz/stream-open.c:18:7: warning: assignment makes
pointer from integer without a cast [-Wint-conversion]
file = fz_fopen_utf8(path, "rb");
^
scripts/../source/fitz/stream-open.c: In function 'fz_open_file':
scripts/../source/fitz/stream-open.c:152:7: warning: assignment makes
pointer from integer without a cast [-Wint-conversion]
file = fz_fopen_utf8(name, "rb");
^
In file included from scripts/cmapdump.c:32:0:
scripts/../source/fitz/time.c: At top level:
scripts/../source/fitz/time.c:85:1: error: conflicting types for
'fz_fopen_utf8'
fz_fopen_utf8(const char *name, const char *mode)
^~~~~~~~~~~~~
In file included from scripts/cmapdump.c:22:0:
scripts/../source/fitz/output.c:200:9: note: previous implicit declaration
of 'fz_fopen_utf8' was here
file = fz_fopen_utf8(filename, append ? "ab" : "wb");
^~~~~~~~~~~~~
make: *** [build/release/scripts/cmapdump.o] Error 1
and the build stops.
The problem seems to be, that although fz_fopen_utf8() is implemented (in
source/fitz/time.c) for all Win32 targets, it is only declared (in
include/mupdf/fitz/system.h) for MSVC targets.
A solution would be to move fz_fopen_utf8() from the '#ifdef _MSC_VER' block to
an '#ifdef _WIN32' (like it's implementation is in source/fitz/time.c). Maybe
while we're at it, also move the declarations for the other functions
implemented for Win32 in source/fitz/time.c, as well.
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are receiving this mail because:
You are the QA Contact for the bug.