Closed mikejsavage closed 4 years ago
Thanks for the report.
I tried to fix it, but cannot test on windows anymore. Can you please check it's ok on windows?
Builds and tests pass
Some warning spam on /W4 (MSVC equivalent of -Wall -Wextra -pedantic) but most of it looks junk
> cl.exe luanacha.c monocypher.c randombytes.c advapi32.lib X:\\lua.lib /W4 /LD /Fe:luanacha.dll
Microsoft (R) C/C++ Optimizing Compiler Version 19.20.27508.1 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
luanacha.c
luanacha.c(146): warning C4057: 'function': 'const char *' differs in indirection to slightly different base types from 'unsigned char [256]'
luanacha.c(132): warning C4101: 'bufln': unreferenced local variable
luanacha.c(174): warning C4057: 'function': 'const uint8_t *' differs in indirection to slightly different base types from 'const char *'
luanacha.c(178): warning C4057: 'function': 'const char *' differs in indirection to slightly different base types from 'unsigned char *'
luanacha.c(161): warning C4101: 'r': unreferenced local variable
luanacha.c(204): warning C4057: 'function': 'const uint8_t *' differs in indirection to slightly different base types from 'const char *'
luanacha.c(211): warning C4057: 'function': 'const char *' differs in indirection to slightly different base types from 'unsigned char *'
luanacha.c(196): warning C4244: 'initializing': conversion from 'lua_Integer' to 'int', possible loss of data
luanacha.c(228): warning C4057: 'function': 'const char *' differs in indirection to slightly different base types from 'unsigned char [32]'
luanacha.c(229): warning C4057: 'function': 'const char *' differs in indirection to slightly different base types from 'unsigned char [32]'
luanacha.c(242): warning C4057: 'function': 'const uint8_t *' differs in indirection to slightly different base types from 'const char *'
luanacha.c(243): warning C4057: 'function': 'const char *' differs in indirection to slightly different base types from 'unsigned char [32]'
luanacha.c(260): warning C4057: 'function': 'const uint8_t *' differs in indirection to slightly different base types from 'const char *'
luanacha.c(261): warning C4057: 'function': 'const char *' differs in indirection to slightly different base types from 'unsigned char [32]'
luanacha.c(278): warning C4057: 'function': 'uint8_t *' differs in indirection to slightly different base types from 'char [64]'
luanacha.c(278): warning C4057: 'function': 'const uint8_t *' differs in indirection to slightly different base types from 'const char *'
luanacha.c(304): warning C4057: 'function': 'const uint8_t *' differs in indirection to slightly different base types from 'const char *'
luanacha.c(298): warning C4244: 'initializing': conversion from 'lua_Integer' to 'int', possible loss of data
luanacha.c(320): warning C4057: 'function': 'const uint8_t *' differs in indirection to slightly different base types from 'const char *'
luanacha.c(339): warning C4057: 'function': 'const char *' differs in indirection to slightly different base types from 'unsigned char [64]'
luanacha.c(335): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
luanacha.c(355): warning C4057: 'function': 'const char *' differs in indirection to slightly different base types from 'unsigned char [32]'
luanacha.c(356): warning C4057: 'function': 'const char *' differs in indirection to slightly different base types from 'unsigned char [32]'
luanacha.c(369): warning C4057: 'function': 'const uint8_t *' differs in indirection to slightly different base types from 'const char *'
luanacha.c(370): warning C4057: 'function': 'const char *' differs in indirection to slightly different base types from 'unsigned char [32]'
luanacha.c(388): warning C4057: 'function': 'const uint8_t *' differs in indirection to slightly different base types from 'const char *'
luanacha.c(389): warning C4057: 'function': 'const char *' differs in indirection to slightly different base types from 'unsigned char [64]'
luanacha.c(407): warning C4057: 'function': 'const uint8_t *' differs in indirection to slightly different base types from 'const char *'
luanacha.c(433): warning C4057: 'function': 'const uint8_t *' differs in indirection to slightly different base types from 'const char *'
luanacha.c(433): warning C4267: 'function': conversion from 'size_t' to 'uint32_t', possible loss of data
luanacha.c(434): warning C4057: 'function': 'const uint8_t *' differs in indirection to slightly different base types from 'char [1]'
luanacha.c(437): warning C4057: 'function': 'const char *' differs in indirection to slightly different base types from 'unsigned char [32]'
luanacha.c(427): warning C4244: 'initializing': conversion from 'lua_Integer' to 'int', possible loss of data
luanacha.c(428): warning C4244: 'initializing': conversion from 'lua_Integer' to 'int', possible loss of data
luanacha.c(424): warning C4101: 'mln': unreferenced local variable
luanacha.c(424): warning C4101: 'kln': unreferenced local variable
luanacha.c(474): warning C4130: '==': logical operation on address of string constant
monocypher.c
monocypher.c(153): warning C4244: 'initializing': conversion from 'u32' to 'u8', possible loss of data
monocypher.c(1267): warning C4244: 'initializing': conversion from 'int' to 'u8', possible loss of data
monocypher.c(1583): warning C4267: 'function': conversion from 'size_t' to 'int', possible loss of data
monocypher.c(1583): warning C4244: '=': conversion from 'int' to 'i8', possible loss of data
monocypher.c(1595): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
monocypher.c(1799): warning C4244: 'initializing': conversion from 'int' to 'u8', possible loss of data
randombytes.c
randombytes.c(27): warning C4244: 'function': conversion from 'unsigned __int64' to 'DWORD', possible loss of data
Generating Code...
Microsoft (R) Incremental Linker Version 14.20.27508.1
Copyright (C) Microsoft Corporation. All rights reserved.
/dll
/implib:luanacha.lib
/out:luanacha.dll
luanacha.obj
monocypher.obj
randombytes.obj
advapi32.lib
X:\lua.lib
Creating library luanacha.lib and object luanacha.exp
Thanks a lot for checking it works on windows. I will also look into the warnings.
Cheers
Phil
Couple things:
i
variable or stdlib.hsee mbedtls or ggentropy