Skip to content

Warnings during compilation #22

Open

Description

@drasko
===> 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'

Activity

  1. mworrell commented on May 19, 2021

    @mworrell
    Member

    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?

  2. mworrell commented on May 19, 2021

    @mworrell
    Member
  3. mworrell commented on Oct 27, 2026

    @mworrell
    Member

    This will be partially solved in #44

  4. mworrell commented on Oct 27, 2026

    @mworrell
    Member

    The updated OpenBSD bcrypt code has now been merged into master, and _BSD_SOURCE has been replaced with _DEFAULT_SOURCE.

    One GCC warning remains: the compiler considers three-digit cost values possible, although the code rejects anything outside 4–31 before formatting. All accepted values fit in the buffer, so this does not indicate truncation for valid inputs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions