Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[bug]: Compilation errors on FreeBSD #916

Description

@InterLinked1

Severity

Minor

Versions

Git

Components/Modules

various

Operating Environment

FreeBSD 14 / gcc 13.2.0

Frequency of Occurrence

Constant

Issue Description

Various minor compilation errors:

Relevant log output

[CCi] asterisk.i -> asterisk.o
asterisk.c: In function 'asterisk_daemon':
asterisk.c:4353:48: error: '%s' directive output may be truncated writing up to 255 bytes into a region of size 235 [-Werror=format-truncation=]
 4353 |                 snprintf(title, sizeof(title), "Asterisk Console on '%s' (pid %ld)", hostname, (long)ast_mainpid);
      |                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~~~
asterisk.c:4353:48: note: directive argument in the range [-2147483648, 2147483647]
asterisk.c:4353:17: note: 'snprintf' output between 31 and 296 bytes into a destination of size 256
 4353 |                 snprintf(title, sizeof(title), "Asterisk Console on '%s' (pid %ld)", hostname, (long)ast_mainpid);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

   [CCi] manager.i -> manager.o
manager.c: In function '__init_manager':
manager.c:10549:50: error: '%s' directive output may be truncated writing up to 255 bytes into a region of size between 176 and 255 [-Werror=format-truncation=]
10549 |                         snprintf(a1, sizeof(a1), "%s:%s:%s", user->username, global_realm, user->secret);
      |                                                  ^~~~~~~~~~                  ~~~~~~~~~~~~
manager.c:10549:25: note: 'snprintf' output 3 or more bytes (assuming 337) into a destination of size 256
10549 |                         snprintf(a1, sizeof(a1), "%s:%s:%s", user->username, global_realm, user->secret);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors


   [CCi] config.i -> config.o
config.c: In function 'handle_include_exec':
config.c:1898:26: error: implicit declaration of function 'WIFEXITED' [-Werror=implicit-function-declaration]
 1898 |                 status = WIFEXITED(status) ? WEXITSTATUS(status) : -1;
      |                          ^~~~~~~~~
config.c:1898:46: error: implicit declaration of function 'WEXITSTATUS' [-Werror=implicit-function-declaration]
 1898 |                 status = WIFEXITED(status) ? WEXITSTATUS(status) : -1;
      |                                              ^~~~~~~~~~~
cc1: all warnings being treated as errors
gmake[2]: *** [/usr/local/src/asterisk-21.5.0-rc1/Makefile.rules:150: config.o] Error 1
gmake[1]: *** [Makefile:396: main] Error 2
gmake[1]: Leaving directory '/usr/local/src/asterisk-21.5.0-rc1'
*** Error code 2


   [CPP] test_crypto.c -> test_crypto.i
test_crypto.c:44:10: fatal error: linux/limits.h: No such file or directory
   44 | #include <linux/limits.h>
      |          ^~~~~~~~~~~~~~~~

   [CCi] res_timing_kqueue.i -> res_timing_kqueue.o
res_timing_kqueue.c: In function 'test_kqueue_timing':
res_timing_kqueue.c:469:99: error: format '%llu' expects argument of type 'long long unsigned int', but argument 6 has type 'uint64_t' {aka 'long unsigned int'} [-Werror=format=]
  469 |                 ast_test_status_update(test, "diff is %llu\n", diff);
      |                                                                                                   ^
      |                                                                                                                       |
      |                                                                                                                       uint64_t {aka long unsigned int}

Asterisk Issue Guidelines

  • Yes, I have read the Asterisk Issue Guidelines

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions