Skip to content

[Build] Add missing <errno.h> include for errno - #2042

Open
nuclearcat wants to merge 1 commit into
intel:masterfrom
nuclearcat:build-missing-errno-include
Open

nuclearcat wants to merge 1 commit into
intel:masterfrom
nuclearcat:build-missing-errno-include

Conversation

@nuclearcat

Copy link
Copy Markdown

mos_query_device_type() uses errno, but mos_bufmgr_api.h does not include its declaring header.

With Clang 22 and libc++ 22, enabling -D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES=1 makes both hwinfo_linux.cpp and mos_auxtable_mgr.cpp fail with:

mos_bufmgr_api.h:434:68: error: use of undeclared identifier 'errno'

Include <errno.h> directly in the header that uses it, alongside the existing C headers. No functional change.

Validation against master 2ad1459d2f80af7b034499238c0022ff00652b70:

  • Both translation units pass syntax checks with default libc++ includes, fail with transitive includes disabled, and pass after this change without forced includes.
  • Both compile to object files with transitive includes disabled after the change.
  • git diff --check passes.

These were targeted checks with ChromeOS Clang/libc++ 22 and Ubuntu host C headers; no full driver build or hardware tests were run.

This also covers the <errno.h> hunk in ChromeOS CL 7964643.

AI assistance used for investigation, validation, and preparing this PR.

mos_query_device_type() uses errno without including its declaring header.
With Clang 22 and libc++ 22, -D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES=1
exposes this as an undeclared identifier when compiling hwinfo_linux.cpp
and mos_auxtable_mgr.cpp.

Include <errno.h> directly in mos_bufmgr_api.h alongside the existing C
headers. Both translation units compile with transitive includes disabled
after this change.

Signed-off-by: Denys Fedoryshchenko <denys.f@collabora.com>
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.

1 participant