erlangpack / bcrypt

Erlang wrapper for OpenBSD's Blowfish password hashing code
https://hex.pm/packages/bcrypt
Other
16 stars 19 forks source link

Warnings during compilation #22

Open drasko opened 3 years ago

drasko commented 3 years ago
===> Compiling bcrypt
make: Entering directory '/home/drasko/erlang/zenith/zenith/_build/default/lib/bcrypt/c_src'
cc -O3 -std=c99 -finline-functions -Wall -Wmissing-prototypes -D_BSD_SOURCE -fPIC -I /usr/lib/erlang/erts-11.2/include/ -I /usr/lib/erlang/lib/erl_interface-4.0.2/include  -c -o /home/drasko/erlang/zenith/zenith/_build/default/lib/bcrypt/c_src/bcrypt_port.o /home/drasko/erlang/zenith/zenith/_build/default/lib/bcrypt/c_src/bcrypt_port.c
In file included from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33:0,
                 from /usr/include/stdio.h:27,
                 from /home/drasko/erlang/zenith/zenith/_build/default/lib/bcrypt/c_src/bcrypt_port.c:17:
/usr/include/features.h:184:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
 # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
   ^~~~~~~
cc -O3 -std=c99 -finline-functions -Wall -Wmissing-prototypes -D_BSD_SOURCE -fPIC -I /usr/lib/erlang/erts-11.2/include/ -I /usr/lib/erlang/lib/erl_interface-4.0.2/include  -c -o /home/drasko/erlang/zenith/zenith/_build/default/lib/bcrypt/c_src/bcrypt_nif.o /home/drasko/erlang/zenith/zenith/_build/default/lib/bcrypt/c_src/bcrypt_nif.c
In file included from /usr/include/assert.h:35:0,
                 from /home/drasko/erlang/zenith/zenith/_build/default/lib/bcrypt/c_src/bcrypt_nif.c:17:
/usr/include/features.h:184:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
 # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
   ^~~~~~~
cc -O3 -std=c99 -finline-functions -Wall -Wmissing-prototypes -D_BSD_SOURCE -fPIC -I /usr/lib/erlang/erts-11.2/include/ -I /usr/lib/erlang/lib/erl_interface-4.0.2/include  -c -o /home/drasko/erlang/zenith/zenith/_build/default/lib/bcrypt/c_src/bcrypt.o /home/drasko/erlang/zenith/zenith/_build/default/lib/bcrypt/c_src/bcrypt.c
In file included from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33:0,
                 from /usr/include/stdio.h:27,
                 from /home/drasko/erlang/zenith/zenith/_build/default/lib/bcrypt/c_src/bcrypt.c:48:
/usr/include/features.h:184:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
 # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
   ^~~~~~~
/home/drasko/erlang/zenith/zenith/_build/default/lib/bcrypt/c_src/bcrypt.c: In function ‘encode_salt’:
/home/drasko/erlang/zenith/zenith/_build/default/lib/bcrypt/c_src/bcrypt.c:137:31: warning: ‘__builtin___snprintf_chk’ output may be truncated before the last format character [-Wformat-truncation=]
  snprintf(salt + 4, 4, "%2.2u$", logr);
                               ^
In file included from /usr/include/stdio.h:862:0,
                 from /home/drasko/erlang/zenith/zenith/_build/default/lib/bcrypt/c_src/bcrypt.c:48:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:64:10: note: ‘__builtin___snprintf_chk’ output between 4 and 5 bytes into a destination of size 4
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __bos (__s), __fmt, __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/drasko/erlang/zenith/zenith/_build/default/lib/bcrypt/c_src/bcrypt.c: In function ‘ts_bcrypt’:
/home/drasko/erlang/zenith/zenith/_build/default/lib/bcrypt/c_src/bcrypt.c:241:36: warning: ‘__builtin___snprintf_chk’ output may be truncated before the last format character [-Wformat-truncation=]
  snprintf(encrypted + i, 4, "%2.2u$", logr);
                                    ^
In file included from /usr/include/stdio.h:862:0,
                 from /home/drasko/erlang/zenith/zenith/_build/default/lib/bcrypt/c_src/bcrypt.c:48:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:64:10: note: ‘__builtin___snprintf_chk’ output between 4 and 5 bytes into a destination of size 4
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __bos (__s), __fmt, __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc -O3 -std=c99 -finline-functions -Wall -Wmissing-prototypes -D_BSD_SOURCE -fPIC -I /usr/lib/erlang/erts-11.2/include/ -I /usr/lib/erlang/lib/erl_interface-4.0.2/include  -c -o /home/drasko/erlang/zenith/zenith/_build/default/lib/bcrypt/c_src/async_queue.o /home/drasko/erlang/zenith/zenith/_build/default/lib/bcrypt/c_src/async_queue.c
In file included from /usr/include/x86_64-linux-gnu/sys/types.h:25:0,
                 from /home/drasko/erlang/zenith/zenith/_build/default/lib/bcrypt/c_src/async_queue.h:36,
                 from /home/drasko/erlang/zenith/zenith/_build/default/lib/bcrypt/c_src/async_queue.c:32:
/usr/include/features.h:184:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
 # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
   ^~~~~~~
cc -O3 -std=c99 -finline-functions -Wall -Wmissing-prototypes -D_BSD_SOURCE -fPIC -I /usr/lib/erlang/erts-11.2/include/ -I /usr/lib/erlang/lib/erl_interface-4.0.2/include  -c -o /home/drasko/erlang/zenith/zenith/_build/default/lib/bcrypt/c_src/blowfish.o /home/drasko/erlang/zenith/zenith/_build/default/lib/bcrypt/c_src/blowfish.c
In file included from /usr/include/x86_64-linux-gnu/sys/types.h:25:0,
                 from /home/drasko/erlang/zenith/zenith/_build/default/lib/bcrypt/c_src/blowfish.c:47:
/usr/include/features.h:184:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
 # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
   ^~~~~~~
cc /home/drasko/erlang/zenith/zenith/_build/default/lib/bcrypt/c_src/bcrypt_port.o /home/drasko/erlang/zenith/zenith/_build/default/lib/bcrypt/c_src/bcrypt_nif.o /home/drasko/erlang/zenith/zenith/_build/default/lib/bcrypt/c_src/bcrypt.o /home/drasko/erlang/zenith/zenith/_build/default/lib/bcrypt/c_src/async_queue.o /home/drasko/erlang/zenith/zenith/_build/default/lib/bcrypt/c_src/blowfish.o  -shared -L /usr/lib/erlang/lib/erl_interface-4.0.2/lib -lei -lpthread -o /home/drasko/erlang/zenith/zenith/_build/default/lib/bcrypt/c_src/../priv/bcrypt_nif.so
cc -O3 -std=c99 -finline-functions -Wall -Wmissing-prototypes -D_BSD_SOURCE -fPIC -I /usr/lib/erlang/erts-11.2/include/ -I /usr/lib/erlang/lib/erl_interface-4.0.2/include bcrypt_port.o bcrypt.o blowfish.o  -L /usr/lib/erlang/lib/erl_interface-4.0.2/lib -lei -lpthread -o ../priv/bcrypt
make: Leaving directory '/home/drasko/erlang/zenith/zenith/_build/default/lib/bcrypt/c_src'
mworrell commented 3 years ago

Hi, Thanks for your report.

We might be able to check if there is a newer bcrypt.c file that could be included and might fix the warnings.

For the _BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE warning, I am not sure if fixing that for macOS/Linux would give a problem on BSD? update: It is a Linux flag - so can be removed.

What OS are you using?

mworrell commented 3 years ago

There is a newer bcrypt version here: https://github.com/openbsd/src/blob/master/lib/libc/crypt/bcrypt.c