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

Issue with include order in log.h #5

Open
mundodisco8 opened this issue Nov 15, 2021 · 0 comments
Open

Issue with include order in log.h #5

mundodisco8 opened this issue Nov 15, 2021 · 0 comments
Labels
0-bug Something isn't working

Comments

@mundodisco8
Copy link

Summary

  • If log.h from the log_system example is included before sl_bluetooth.h, gcc complains about two forward declarations on it. log.h needs it to define two forward declarations on it. If a file (like app.c) includes sl_bluetooth.h, it masks this error and the project compiles.
  • Use case / test scenario
  • Reference environment
    • GCC 10.2 Bluetooth SDK 3.2.3
  • Simplicity Studio version: 5.2.3.1
  • The issue reproducible with SDK sample application.

To Reproduce
Steps to reproduce the behavior:

  1. Import the log_system example to SS5
  2. Open app.c
  3. Move the line #include "log.h" above the line including sl_bluetooth.h.
  4. Compile the project

Expected behavior
The project should compile independently of the location of the #include line.

Actual behavior
The project won't compile if log.h is inlcuded before sl_bluetooth.h

Additional context
I have set clang-formatter to rearrange my includes by alphabetical order and that's how I found out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0-bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant