Closed pmqs closed 6 months ago
I pushed a commit on the develop branch that should address all of those. Then again, maybe not, since I don't have a way to test it. Please give it try. Thanks.
Commit 985a62d11802b44d1d1049ddd692038923da6f0b is broken:
wcstombs_s
is not available in every toolchainwcstombs_s
is most possibly not available in WinCE-targeting toolchains_SH_DENYNO
needs including share.h
, and might not be in every toolchain_setmode
is not available in DJGPP (i.e. the change in minigzip.c, etc)Can it be reverted, please?
- (maybe more, didn't fully check..)
@sezero Please complete your examination and let me know what else you believe is broken. Thanks.
- (maybe more, didn't fully check..)
@sezero Please complete your examination and let me know what else you believe is broken. Thanks.
Verified that DJGPP build of test/minigzip.c is broken:
test/minigzip.c: In function `file_compress':
test/minigzip.c:429: warning: passing arg 3 of `string_copy' as unsigned due to prototype
test/minigzip.c: In function `main':
test/minigzip.c:541: warning: implicit declaration of function `_setmode'
test/minigzip.c:541: warning: implicit declaration of function `_fileno'
Same will be true whereever _fileno
and _setmode
are used: Those
underscore prepended versions of libc calls are for windows-only and
not others.
Speaking of djgpp, building libz already has warnings (not related to this particular ticket, but still:)
gzlib.c: In function `gz_open':
gzlib.c:245: warning: implicit declaration of function `lseek'
i586-pc-msdosdjgpp-gcc -MMD -O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion -Wstrict-prototypes -Wmissing-prototypes -c gzread.c -o gzread.o
gzread.c: In function `gz_load':
gzread.c:22: warning: implicit declaration of function `read'
gzread.c: In function `gzclose_r':
gzread.c:599: warning: implicit declaration of function `close'
i586-pc-msdosdjgpp-gcc -MMD -O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion -Wstrict-prototypes -Wmissing-prototypes -c gzwrite.c -o gzwrite.o
gzwrite.c: In function `gz_comp':
gzwrite.c:78: warning: implicit declaration of function `write'
gzwrite.c: In function `gzclose_w':
gzwrite.c:627: warning: implicit declaration of function `close'
deflate.c: In function `deflate_stored':
deflate.c:1671: warning: passing arg 4 of `_tr_stored_block' as signed due to prototype
deflate.c:1795: warning: passing arg 4 of `_tr_stored_block' as signed due to prototype
Including unistd.h
fixes the posix file io functions' prototype warnings,
only the last warning from deflate.c remains.
diff --git a/gzguts.h b/gzguts.h
index bd0a6fe..afb14f1 100644
--- a/gzguts.h
+++ b/gzguts.h
@@ -44,6 +44,10 @@
# include <sys/stat.h>
#endif
+#if defined __DJGPP__
+# include <unistd.h>
+#endif
+
#if defined(_WIN32) && !defined(WIDECHAR)
# define WIDECHAR
#endif
Verified that WinCE build is broken. Using a mingw-based toolchain, for e.g.:
$ make -f win32/Makefile.gcc PREFIX=arm-mingw32ce-
[...]
gzlib.c: In function 'gz_strwinerror':
gzlib.c:56:9: warning: implicit declaration of function 'wcstombs_s'; did you mean 'wcstombs'? [-Wimplicit-function-declaration]
56 | wcstombs_s(&len, buf, sizeof(buf), msgbuf, chars + 1);
| ^~~~~~~~~~
| wcstombs
gzlib.c: In function 'gz_open':
gzlib.c:235:9: warning: implicit declaration of function '_wsopen_s'; did you mean '_wopen'? [-Wimplicit-function-declaration]
235 | _wsopen_s(&state->fd, path, oflag, _SH_DENYNO, _S_IREAD | _S_IWRITE);
| ^~~~~~~~~
| _wopen
gzlib.c:9:17: warning: implicit declaration of function '_lseeki64'; did you mean 'gzseek64'? [-Wimplicit-function-declaration]
9 | # define LSEEK _lseeki64
| ^~~~~~~~~
gzlib.c:245:9: note: in expansion of macro 'LSEEK'
245 | LSEEK(state->fd, 0, SEEK_END); /* so gzoffset() is correct */
| ^~~~~
/opt/cross_wince-arm/bin/../lib/gcc/arm-mingw32ce/9.3.0/../../../../arm-mingw32ce/bin/ld: gzlib.o:gzlib.c:(.text+0x3c8): undefined reference to `wcstombs_s'
gzlib.o:gzlib.c:(.text+0x3c8): relocation truncated to fit: ARM_26 against undefined symbol `wcstombs_s'
/opt/cross_wince-arm/bin/../lib/gcc/arm-mingw32ce/9.3.0/../../../../arm-mingw32ce/bin/ld: gzlib.o:gzlib.c:(.text+0x430): undefined reference to `_wsopen_s'
gzlib.o:gzlib.c:(.text+0x430): relocation truncated to fit: ARM_26 against undefined symbol `_wsopen_s'
/opt/cross_wince-arm/bin/../lib/gcc/arm-mingw32ce/9.3.0/../../../../arm-mingw32ce/bin/ld: gzlib.o:gzlib.c:(.text+0x448): undefined reference to `_lseeki64'
gzlib.o:gzlib.c:(.text+0x448): relocation truncated to fit: ARM_26 against undefined symbol `_lseeki64'
/opt/cross_wince-arm/bin/../lib/gcc/arm-mingw32ce/9.3.0/../../../../arm-mingw32ce/bin/ld: gzlib.o:gzlib.c:(.text+0x494): undefined reference to `_lseeki64'
gzlib.o:gzlib.c:(.text+0x494): relocation truncated to fit: ARM_26 against undefined symbol `_lseeki64'
/opt/cross_wince-arm/bin/../lib/gcc/arm-mingw32ce/9.3.0/../../../../arm-mingw32ce/bin/ld: gzlib.o:gzlib.c:(.text+0x4d8): undefined reference to `wcstombs_s'
gzlib.o:gzlib.c:(.text+0x4d8): relocation truncated to fit: ARM_26 against undefined symbol `wcstombs_s'
/opt/cross_wince-arm/bin/../lib/gcc/arm-mingw32ce/9.3.0/../../../../arm-mingw32ce/bin/ld: gzlib.o:gzlib.c:(.text+0x5a4): undefined reference to `wcstombs_s'
gzlib.o:gzlib.c:(.text+0x5a4): relocation truncated to fit: ARM_26 against undefined symbol `wcstombs_s'
/opt/cross_wince-arm/bin/../lib/gcc/arm-mingw32ce/9.3.0/../../../../arm-mingw32ce/bin/ld: gzlib.o:gzlib.c:(.text+0x704): undefined reference to `_lseeki64'
gzlib.o:gzlib.c:(.text+0x704): relocation truncated to fit: ARM_26 against undefined symbol `_lseeki64'
/opt/cross_wince-arm/bin/../lib/gcc/arm-mingw32ce/9.3.0/../../../../arm-mingw32ce/bin/ld: gzlib.o:gzlib.c:(.text+0x8cc): undefined reference to `_lseeki64'
gzlib.o:gzlib.c:(.text+0x8cc): relocation truncated to fit: ARM_26 against undefined symbol `_lseeki64'
/opt/cross_wince-arm/bin/../lib/gcc/arm-mingw32ce/9.3.0/../../../../arm-mingw32ce/bin/ld: gzlib.o:gzlib.c:(.text+0xa7c): undefined reference to `_lseeki64'
gzlib.o:gzlib.c:(.text+0xa7c): relocation truncated to fit: ARM_26 against undefined symbol `_lseeki64'
/opt/cross_wince-arm/bin/../lib/gcc/arm-mingw32ce/9.3.0/../../../../arm-mingw32ce/bin/ld: gzlib.o:gzlib.c:(.text+0xba0): undefined reference to `_lseeki64'
gzlib.o:gzlib.c:(.text+0xba0): relocation truncated to fit: ARM_26 against undefined symbol `_lseeki64'
/opt/cross_wince-arm/bin/../lib/gcc/arm-mingw32ce/9.3.0/../../../../arm-mingw32ce/bin/ld: gzlib.o:gzlib.c:(.text+0xc04): undefined reference to `_lseeki64'
gzlib.o:gzlib.c:(.text+0xc04): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
make: *** [win32/Makefile.gcc:91: zlib1.dll] Error 1
However, even if I back out the changes from that commit, it's still
broken because _lseeki64
isn't available.
I have nothing else, at the moment.
I pushed a commit on the develop branch that should address all of those. Then again, maybe not, since I don't have a way to test it. Please give it try. Thanks.
Sorry, still seeing warnings with clang 16 on Windows -- it ships with Visual Studio.
All is fine on Linux with clang 16.
[33/37] Building C object CMakeFiles/minigzip.dir/test/minigzip.c.obj
D:/Linux/develop/zlib/test/minigzip.c:431:10: warning: 'fopen' is deprecated: This function or variable may
be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. [-Wdeprecated-declarations]
in = fopen(file, "rb");
^
C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt\stdio.h:212:20: note: 'fopen' has been explicitly marked deprecated here
_Check_return_ _CRT_INSECURE_DEPRECATE(fopen_s)
^
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime.h:355:55: note: expanded from macro '_CRT_INSECURE_DEPRECATE'
#define _CRT_INSECURE_DEPRECATE(_Replacement) _CRT_DEPRECATE_TEXT( \
^
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime.h:345:47: note: expanded from macro '_CRT_DEPRECATE_TEXT'
#define _CRT_DEPRECATE_TEXT(_Text) __declspec(deprecated(_Text))
^
D:/Linux/develop/zlib/test/minigzip.c:478:11: warning: 'fopen' is deprecated: This function or variable may
be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. [-Wdeprecated-declarations]
out = fopen(outfile, "wb");
^
C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt\stdio.h:212:20: note: 'fopen' has been explicitly marked deprecated here
_Check_return_ _CRT_INSECURE_DEPRECATE(fopen_s)
^
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime.h:355:55: note: expanded from macro '_CRT_INSECURE_DEPRECATE'
#define _CRT_INSECURE_DEPRECATE(_Replacement) _CRT_DEPRECATE_TEXT( \
^
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime.h:345:47: note: expanded from macro '_CRT_DEPRECATE_TEXT'
#define _CRT_DEPRECATE_TEXT(_Text) __declspec(deprecated(_Text))
^
D:/Linux/develop/zlib/test/minigzip.c:569:33: warning: 'fopen' is deprecated: This function or variable may
be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. [-Wdeprecated-declarations]
FILE * in = fopen(*argv, "rb");
^
C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt\stdio.h:212:20: note: 'fopen' has been explicitly marked deprecated here
_Check_return_ _CRT_INSECURE_DEPRECATE(fopen_s)
^
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime.h:355:55: note: expanded from macro '_CRT_INSECURE_DEPRECATE'
#define _CRT_INSECURE_DEPRECATE(_Replacement) _CRT_DEPRECATE_TEXT( \
^
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime.h:345:47: note: expanded from macro '_CRT_DEPRECATE_TEXT'
#define _CRT_DEPRECATE_TEXT(_Text) __declspec(deprecated(_Text))
^
3 warnings generated.
[34/37] Building C object CMakeFiles/example.dir/test/example.c.obj
D:/Linux/develop/zlib/test/example.c:70:5: warning: 'strcpy' is deprecated: This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. [-Wdeprecated-declarations]
strcpy((char*)uncompr, "garbage");
^
C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt\string.h:130:1: note: 'strcpy' has been explicitly marked deprecated here
__DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1(
^
C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt\corecrt.h:835:5: note: expanded from macro
'__DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1'
__DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1_EX(_ReturnType, _ReturnPolicy, _DeclSpec, _FuncName, _FuncName##_s, _DstType, _SalAttributeDst, _DstType, _Dst, _TType1, _TArg1)
^
C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt\corecrt.h:1894:17: note: expanded from macro '__DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1_EX'
_CRT_INSECURE_DEPRECATE(_SecureFuncName) _DeclSpec _ReturnType __cdecl _FuncName(_SalAttributeDst _DstType *_Dst, _TType1 _TArg1);
^
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime.h:355:55: note: expanded from macro '_CRT_INSECURE_DEPRECATE'
#define _CRT_INSECURE_DEPRECATE(_Replacement) _CRT_DEPRECATE_TEXT( \
^
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime.h:345:47: note: expanded from macro '_CRT_DEPRECATE_TEXT'
#define _CRT_DEPRECATE_TEXT(_Text) __declspec(deprecated(_Text))
^
D:/Linux/develop/zlib/test/example.c:117:5: warning: 'strcpy' is deprecated: This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. [-Wdeprecated-declarations]
strcpy((char*)uncompr, "garbage");
^
C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt\string.h:130:1: note: 'strcpy' has been explicitly marked deprecated here
__DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1(
^
C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt\corecrt.h:835:5: note: expanded from macro
'__DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1'
__DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1_EX(_ReturnType, _ReturnPolicy, _DeclSpec, _FuncName, _FuncName##_s, _DstType, _SalAttributeDst, _DstType, _Dst, _TType1, _TArg1)
^
C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt\corecrt.h:1894:17: note: expanded from macro '__DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1_EX'
_CRT_INSECURE_DEPRECATE(_SecureFuncName) _DeclSpec _ReturnType __cdecl _FuncName(_SalAttributeDst _DstType *_Dst, _TType1 _TArg1);
^
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime.h:355:55: note: expanded from macro '_CRT_INSECURE_DEPRECATE'
#define _CRT_INSECURE_DEPRECATE(_Replacement) _CRT_DEPRECATE_TEXT( \
^
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime.h:345:47: note: expanded from macro '_CRT_DEPRECATE_TEXT'
#define _CRT_DEPRECATE_TEXT(_Text) __declspec(deprecated(_Text))
^
D:/Linux/develop/zlib/test/example.c:208:5: warning: 'strcpy' is deprecated: This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. [-Wdeprecated-declarations]
strcpy((char*)uncompr, "garbage");
^
C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt\string.h:130:1: note: 'strcpy' has been explicitly marked deprecated here
__DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1(
^
C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt\corecrt.h:835:5: note: expanded from macro
'__DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1'
__DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1_EX(_ReturnType, _ReturnPolicy, _DeclSpec, _FuncName, _FuncName##_s, _DstType, _SalAttributeDst, _DstType, _Dst, _TType1, _TArg1)
^
C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt\corecrt.h:1894:17: note: expanded from macro '__DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1_EX'
_CRT_INSECURE_DEPRECATE(_SecureFuncName) _DeclSpec _ReturnType __cdecl _FuncName(_SalAttributeDst _DstType *_Dst, _TType1 _TArg1);
^
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime.h:355:55: note: expanded from macro '_CRT_INSECURE_DEPRECATE'
#define _CRT_INSECURE_DEPRECATE(_Replacement) _CRT_DEPRECATE_TEXT( \
^
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime.h:345:47: note: expanded from macro '_CRT_DEPRECATE_TEXT'
#define _CRT_DEPRECATE_TEXT(_Text) __declspec(deprecated(_Text))
^
D:/Linux/develop/zlib/test/example.c:300:5: warning: 'strcpy' is deprecated: This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. [-Wdeprecated-declarations]
strcpy((char*)uncompr, "garbage");
^
C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt\string.h:130:1: note: 'strcpy' has been explicitly marked deprecated here
__DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1(
^
C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt\corecrt.h:835:5: note: expanded from macro
'__DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1'
__DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1_EX(_ReturnType, _ReturnPolicy, _DeclSpec, _FuncName, _FuncName##_s, _DstType, _SalAttributeDst, _DstType, _Dst, _TType1, _TArg1)
^
C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt\corecrt.h:1894:17: note: expanded from macro '__DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1_EX'
_CRT_INSECURE_DEPRECATE(_SecureFuncName) _DeclSpec _ReturnType __cdecl _FuncName(_SalAttributeDst _DstType *_Dst, _TType1 _TArg1);
^
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime.h:355:55: note: expanded from macro '_CRT_INSECURE_DEPRECATE'
#define _CRT_INSECURE_DEPRECATE(_Replacement) _CRT_DEPRECATE_TEXT( \
^
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime.h:345:47: note: expanded from macro '_CRT_DEPRECATE_TEXT'
#define _CRT_DEPRECATE_TEXT(_Text) __declspec(deprecated(_Text))
^
D:/Linux/develop/zlib/test/example.c:374:5: warning: 'strcpy' is deprecated: This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. [-Wdeprecated-declarations]
strcpy((char*)uncompr, "garbage");
^
C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt\string.h:130:1: note: 'strcpy' has been explicitly marked deprecated here
__DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1(
^
C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt\corecrt.h:835:5: note: expanded from macro
'__DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1'
__DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1_EX(_ReturnType, _ReturnPolicy, _DeclSpec, _FuncName, _FuncName##_s, _DstType, _SalAttributeDst, _DstType, _Dst, _TType1, _TArg1)
^
C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt\corecrt.h:1894:17: note: expanded from macro '__DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1_EX'
_CRT_INSECURE_DEPRECATE(_SecureFuncName) _DeclSpec _ReturnType __cdecl _FuncName(_SalAttributeDst _DstType *_Dst, _TType1 _TArg1);
^
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime.h:355:55: note: expanded from macro '_CRT_INSECURE_DEPRECATE'
#define _CRT_INSECURE_DEPRECATE(_Replacement) _CRT_DEPRECATE_TEXT( \
^
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime.h:345:47: note: expanded from macro '_CRT_DEPRECATE_TEXT'
#define _CRT_DEPRECATE_TEXT(_Text) __declspec(deprecated(_Text))
^
D:/Linux/develop/zlib/test/example.c:449:5: warning: 'strcpy' is deprecated: This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. [-Wdeprecated-declarations]
strcpy((char*)uncompr, "garbage");
^
C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt\string.h:130:1: note: 'strcpy' has been explicitly marked deprecated here
__DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1(
^
C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt\corecrt.h:835:5: note: expanded from macro
'__DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1'
__DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1_EX(_ReturnType, _ReturnPolicy, _DeclSpec, _FuncName, _FuncName##_s, _DstType, _SalAttributeDst, _DstType, _Dst, _TType1, _TArg1)
^
C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt\corecrt.h:1894:17: note: expanded from macro '__DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1_EX'
_CRT_INSECURE_DEPRECATE(_SecureFuncName) _DeclSpec _ReturnType __cdecl _FuncName(_SalAttributeDst _DstType *_Dst, _TType1 _TArg1);
^
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime.h:355:55: note: expanded from macro '_CRT_INSECURE_DEPRECATE'
#define _CRT_INSECURE_DEPRECATE(_Replacement) _CRT_DEPRECATE_TEXT( \
^
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\vcruntime.h:345:47: note: expanded from macro '_CRT_DEPRECATE_TEXT'
#define _CRT_DEPRECATE_TEXT(_Text) __declspec(deprecated(_Text))
^
6 warnings generated.
Sorry, still seeing warnings with clang 16 on Windows -- it ships with Visual Studio.
Possibly the best solution for those warnings is disabling them, like:
#if defined _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#endif
If, e.g. fopen
, is used correctly then those MSVC warnings are just annoying noise.
Verified that DJGPP build of test/minigzip.c is broken: ... Those underscore prepended versions of libc calls are for windows-only and not others.
Yet it appears that DJGPP is definining _WIN32
. Is that correct?
Possibly the best solution for those warnings is disabling them, like: ...
define _CRT_SECURE_NO_WARNINGS
Yes, that's what I did for the library, but I missed example.c and minigzip.c.
@pmqs Ok, how about now?
Verified that DJGPP build of test/minigzip.c is broken: ... Those underscore prepended versions of libc calls are for windows-only and not others.
Yet it appears that DJGPP is definining
_WIN32
. Is that correct?
Most certainly not
@pmqs Ok, how about now?
That's fine now. Updating the workflow to use this clang + cmake on MSVC
@sezero Can you provide the output on DJGPP of gcc -dM -E empty.c
, where empty.c is a zero-length file? Thanks.
@sezero Can you provide the output on DJGPP of
gcc -dM -E empty.c
, where empty.c is a zero-length file?
$ i586-pc-msdosdjgpp-gcc -E -dM -xc /dev/null
#define __GO32 1
#define __DBL_MIN_EXP__ (-1021)
#define __FLT_MIN__ 1.17549435e-38F
#define __CHAR_BIT__ 8
#define __WCHAR_MAX__ 65535U
#define __DBL_DENORM_MIN__ 4.9406564584124654e-324
#define __FLT_EVAL_METHOD__ 2
#define __DBL_MIN_10_EXP__ (-307)
#define __FINITE_MATH_ONLY__ 0
#define __GNUC_PATCHLEVEL__ 6
#define __SHRT_MAX__ 32767
#define __LDBL_MAX__ 1.18973149535723176502e+4932L
#define __unix 1
#define __LDBL_MAX_EXP__ 16384
#define __DJGPP 2
#define __SCHAR_MAX__ 127
#define __USER_LABEL_PREFIX__ _
#define __STDC_HOSTED__ 1
#define __LDBL_HAS_INFINITY__ 1
#define __MSDOS__ 1
#define __DBL_DIG__ 15
#define __FLT_EPSILON__ 1.19209290e-7F
#define __LDBL_MIN__ 3.36210314311209350626e-4932L
#define __DJGPP__ 2
#define __unix__ 1
#define __DECIMAL_DIG__ 21
#define __LDBL_HAS_QUIET_NAN__ 1
#define __GNUC__ 3
#define __tune_i586__ 1
#define __DBL_MAX__ 1.7976931348623157e+308
#define __DBL_HAS_INFINITY__ 1
#define __DJGPP_MINOR__ 5
#define __DBL_MAX_EXP__ 1024
#define __LONG_LONG_MAX__ 9223372036854775807LL
#define __GXX_ABI_VERSION 1002
#define __FLT_MIN_EXP__ (-125)
#define __GO32__ 1
#define GO32 1
#define DJGPP_MINOR 5
#define __DBL_MIN__ 2.2250738585072014e-308
#define MSDOS 1
#define __DBL_HAS_QUIET_NAN__ 1
#define __REGISTER_PREFIX__
#define __NO_INLINE__ 1
#define __i386 1
#define __FLT_MANT_DIG__ 24
#define __VERSION__ "3.4.6"
#define i386 1
#define unix 1
#define __i386__ 1
#define __SIZE_TYPE__ long unsigned int
#define __FLT_RADIX__ 2
#define __LDBL_EPSILON__ 1.08420217248550443401e-19L
#define __FLT_HAS_QUIET_NAN__ 1
#define __FLT_MAX_10_EXP__ 38
#define __LONG_MAX__ 2147483647L
#define __FLT_HAS_INFINITY__ 1
#define __tune_pentium__ 1
#define DJGPP 2
#define __LDBL_MANT_DIG__ 64
#define __WCHAR_TYPE__ short unsigned int
#define __FLT_DIG__ 6
#define __INT_MAX__ 2147483647
#define __FLT_MAX_EXP__ 128
#define __DBL_MANT_DIG__ 53
#define __WINT_TYPE__ int
#define __LDBL_MIN_EXP__ (-16381)
#define __LDBL_MAX_10_EXP__ 4932
#define __DBL_EPSILON__ 2.2204460492503131e-16
#define __FLT_DENORM_MIN__ 1.40129846e-45F
#define __MSDOS 1
#define __FLT_MAX__ 3.40282347e+38F
#define __FLT_MIN_10_EXP__ (-37)
#define __GNUC_MINOR__ 4
#define __DBL_MAX_10_EXP__ 308
#define __LDBL_DENORM_MIN__ 3.64519953188247460253e-4951L
#define __PTRDIFF_TYPE__ int
#define __LDBL_MIN_10_EXP__ (-4931)
#define __DJGPP_MINOR 5
#define __LDBL_DIG__ 18
@sezero Please give the develop branch a try on DJGPP.
$ make -f msdos/Makefile.dj2 CC=i586-pc-msdosdjgpp-gcc AR="i586-pc-msdosdjgpp-ar rcs" libz.a
[...]
i586-pc-msdosdjgpp-gcc -MMD -O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion -Wstrict-prototypes -Wmissing-prototypes -c gzlib.c -o gzlib.o
gzlib.c: In function `gz_open':
gzlib.c:247: warning: passing arg 2 of `llseek' with different width due to prototype
gzlib.c:253: warning: passing arg 2 of `llseek' with different width due to prototype
gzlib.c: In function `gzrewind':
gzlib.c:337: warning: passing arg 2 of `llseek' with different width due to prototype
gzlib.c: In function `gzseek64':
gzlib.c:374: warning: passing arg 2 of `llseek' with different width due to prototype
gzlib.c: In function `gzoffset64':
gzlib.c:460: warning: passing arg 2 of `llseek' with different width due to prototype
llseek is prototyped like this:
offset_t llseek(int _fildes, offset_t _offset, int _whence);
And offset_t
is typedef'ed as long long
The warnings are due to -Wconversion
and I think that warning flag
can be dropped.
@sezero Please try applying this diff:
diff --git a/zconf.h b/zconf.h
index 0a9f22c..fbe7a79 100644
--- a/zconf.h
+++ b/zconf.h
@@ -511,12 +511,12 @@ typedef uLong FAR uLongf;
#if !defined(_WIN32) && defined(Z_LARGE64)
# define z_off64_t off64_t
+#elif defined(_WIN32) && !defined(__GNUC__)
+# define z_off64_t __int64
+#elif defined(__GO32__)
+# define z_off64_t offset_t
#else
-# if defined(_WIN32) && !defined(__GNUC__)
-# define z_off64_t __int64
-# else
-# define z_off64_t z_off_t
-# endif
+# define z_off64_t z_off_t
#endif
/* MVS linker does not support external names larger than 8 bytes */
and if you're using configure or cmake, then also apply it to zconf.h.in or zconf.h.cmakein respectively.
@sezero Please try applying this diff:
$ make -f msdos/Makefile.dj2 CC=i586-pc-msdosdjgpp-gcc AR="i586-pc-msdosdjgpp-ar rcs" libz.a
i586-pc-msdosdjgpp-gcc -MMD -O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion -Wstrict-prototypes -Wmissing-prototypes -c adler32.c -o adler32.o
adler32.c: In function `adler32_combine':
adler32.c:159: warning: passing arg 3 of `adler32_combine_' with different width due to prototype
adler32.c: At top level:
adler32.c:162: error: conflicting types for 'adler32_combine64'
zutil.h:173: error: previous declaration of 'adler32_combine64' was here
adler32.c:162: error: conflicting types for 'adler32_combine64'
zutil.h:173: error: previous declaration of 'adler32_combine64' was here
make: *** [adler32.o] Error 1
and if you're using configure or cmake, then also apply it to zconf.h.in or zconf.h.cmakein respectively.
No, I am trying with the plain makefile
@sezero Thanks. That exposed an inconsistency between header files which has been corrected. Please try the develop branch on DJGPP and let me know how it goes. Thanks.
@sezero Thanks. That exposed an inconsistency between header files which has been corrected. Please try the develop branch on DJGPP and let me know how it goes. Thanks.
Thanks for working on this.
With current HEAD, I get the following warnings now:
$ make -f msdos/Makefile.dj2 CC=i586-pc-msdosdjgpp-gcc AR="i586-pc-msdosdjgpp-ar rcs" libz.a
i586-pc-msdosdjgpp-gcc -MMD -O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion -Wstrict-prototypes -Wmissing-prototypes -c gzlib.c -o gzlib.o
gzlib.c: In function `gz_open':
gzlib.c:247: warning: passing arg 2 of `llseek' with different width due to prototype
gzlib.c:253: warning: passing arg 2 of `llseek' with different width due to prototype
gzlib.c: In function `gzoffset64':
gzlib.c:460: warning: passing arg 2 of `llseek' with different width due to prototype
Are you giving me all of the warnings each time? I was surprised to see those warnings about the type of a 0
disappear, since I wasn't expecting them to. But now they're back. That's actually a pretty dumb warning — the constant 0
should match any numeric type. That's a compiler bug. So, yes, at this point you should simply not activate that warning, I believe -Wconversion.
Are you giving me all of the warnings each time?
Yes
I was surprised to see those warnings about the type of a
0
disappear, since I wasn't expecting them to. But now they're back. That's actually a pretty dumb warning — the constant0
should match any numeric type. That's a compiler bug. So, yes, at this point you should simply not activate that warning, I believe -Wconversion.
Yes, and I am not activating it myself: -Wconversion is in msdos/Makefile.dj2, removing it was my original suggestion.
Ah, ok. I will remove that warning option.
It is truly odd that nothing changed to make those llseek(..., 0, ...)
warnings go away, and nothing changed to make them come back. I guess it will forever remain a mystery.
Question about _wcelseek
change of commit fd5fe8b17e27ab92dcc70ed4974915b8dbe2a553:
Does zlib require the wcecompat library somehow: https://github.com/mauricek/wcecompat ?
AFAIK, _wcelseek
is not part of WinCE api. (There is also the wince code in unzip,
e.g. https://github.com/LuaDist/unzip. I guess, unlike MinGW, posix file io is not part of Microsoft
WinCE SDKs?..)
@sezero Thanks. Is there an alternative to _lseeki64()
in WinCE? Is there a way to look in your MinGW tool chain?
Is there a way to look in your MinGW tool chain?
I tried with the one from here: https://max.kellermann.name/projects/cegcc/
@sezero Thanks. Is there an alternative to
_lseeki64()
in WinCE?
As I understand it (not sure though) after looking at non-microsoft solutions, there is no posix io (open, read,write, lseek..) in microsoft wince toolchains, so people provide custom (but trivial) ones like mingw does: see e.g. the mingwrt sources on the page I linked above
Not sure if this is intended to be a supported combination, but a Windows build using
clang
&cmake
spits out plenty of Compiler warnings