Skip to content

lib: Use PROJECT_SYSTEM to provide compile time warning#360

Open
glneo wants to merge 1 commit intoOpenAMP:mainfrom
glneo:compile-warnings
Open

lib: Use PROJECT_SYSTEM to provide compile time warning#360
glneo wants to merge 1 commit intoOpenAMP:mainfrom
glneo:compile-warnings

Conversation

@glneo
Copy link
Copy Markdown
Contributor

@glneo glneo commented Apr 20, 2026

Several of these were not correct in some spots. Use the automatic replacement to fill this in when installing the headers.

@arnopo
Copy link
Copy Markdown
Contributor

arnopo commented Apr 27, 2026

I would prefer to limit the use of cmake variable in source code when possible.

Could you detail side effect you observe?

@arnopo arnopo requested review from arnopo, edmooring and tnmysh April 27, 2026 11:50
@glneo
Copy link
Copy Markdown
Contributor Author

glneo commented Apr 27, 2026

What happens here for example is if I #include <metal/system/freertos/alloc.h>, the compiler errors out with: Include metal/alloc.h instead of metal/freertos/alloc.h. Which would be more helpful if I had included metal/freertos/alloc.h anywhere, I could grep that and fix it, but the included file is metal/system/freertos/alloc.h.

Maybe an easier solution is just to have the message state: "Do not include this file directly, include <metal/alloc.h> instead". Then folks could just see what file they included from the compiler error line and remove that inclusion.

Copy link
Copy Markdown
Contributor

@edmooring edmooring left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like your second solution avoiding the CMake variables in the code better.

@arnopo
Copy link
Copy Markdown
Contributor

arnopo commented Apr 28, 2026

Maybe an easier solution is just to have the message state: "Do not include this file directly, include <metal/alloc.h> instead". Then folks could just see what file they included from the compiler error line and remove that inclusion.

+1 for this solution

Some of these were not correct in some spots. Instead of trying to include
the name of the current file in this warning (which might change), only
state which file should be included instead.

Signed-off-by: Andrew Davis <afd@ti.com>
@glneo glneo force-pushed the compile-warnings branch from 5ab8a3d to 2e156f1 Compare April 28, 2026 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants