Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BT CTS fails to build with some libCs #81416

Open
aescolar opened this issue Nov 14, 2024 · 0 comments · May be fixed by #81415
Open

BT CTS fails to build with some libCs #81416

aescolar opened this issue Nov 14, 2024 · 0 comments · May be fixed by #81415
Assignees
Labels
area: Bluetooth bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug

Comments

@aescolar
Copy link
Member

aescolar commented Nov 14, 2024

Describe the bug
The BT CTS service fails to build with some libCs

To Reproduce
Steps to reproduce the behavior:

  1. mkdir build; cd build
  2. cmake -GNinja -DBOARD=nrf52_bsim ../samples/bluetooth/peripheral/
  3. ninja
  4. See error

Expected behavior
No build failures

Impact
Samples fails to build for some targets or with some libCs

Logs and console output

[97/247] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/bluetooth/services/cts.c.obj
FAILED: zephyr/CMakeFiles/zephyr.dir/subsys/bluetooth/services/cts.c.obj
[..]
zephyr.dir/subsys/bluetooth/services/cts.c.obj -c subsys/bluetooth/services/cts.c
In file included from /usr/include/sys/types.h:130,
                 from include/zephyr/bluetooth/gatt.h:23,
                 from subsys/bluetooth/services/cts.c:15:
/usr/include/bits/types/timer_t.h:7:19: error: conflicting types for ‘timer_t’; have ‘__timer_t’ {aka ‘void *’}
    7 | typedef __timer_t timer_t;
      |                   ^~~~~~~
In file included from include/zephyr/posix/time.h:61,
                 from subsys/bluetooth/services/cts.c:12:
include/zephyr/posix/posix_types.h:93:23: note: previous declaration of ‘timer_t’ with type ‘timer_t’ {aka ‘long unsigned int’}
   93 | typedef unsigned long timer_t;
      |                       ^~~~~~~
subsys/bluetooth/services/cts.c: In function ‘bt_cts_time_from_unix_ms’:
subsys/bluetooth/services/cts.c:74:13: warning: implicit declaration of function ‘gmtime_r’; did you mean ‘gmtime’? [-Wimplicit-function-declaration]
   74 |         if (gmtime_r(&unix_ts, &date_time) == NULL) {
      |             ^~~~~~~~
      |             gmtime
subsys/bluetooth/services/cts.c:74:44: warning: comparison between pointer and integer
   74 |         if (gmtime_r(&unix_ts, &date_time) == NULL) {
      |                                            ^~

Environment (please complete the following information):

  • OS: Ubuntu Linux 24.04
  • Toolchain (e.g Zephyr SDK, ...): 0.17 or host gcc 14.2
  • Commit SHA or Version used: 8dc3f85

Additional context
Related to #81412
Service introduced in 957d598

@aescolar aescolar added bug The issue is a bug, or the PR is fixing a bug area: Bluetooth labels Nov 14, 2024
@jhedberg jhedberg assigned aescolar and unassigned jhedberg and alwa-nordic Nov 15, 2024
@jhedberg jhedberg added the priority: medium Medium impact/importance bug label Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Bluetooth bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants