Skip to main content

W0093 - Unused header

Example​

%% include/legacy.hrl, which no file includes
-define(LEGACY_TIMEOUT, 5000).
%% <- warning: W0093: No file includes this header.

Explanation​

No module or header in the project includes this header, with either -include or -include_lib, so its content is dead code. It was usually left behind when the last module including it was changed or removed.

Generated headers are not reported, nor are headers that share their file name with an included header of the same application: the build system may map that include to this header, as Buck includes overrides do.

Fix​

Delete the header. If it is meant for code outside the project, such as a library's public API, suppress the diagnostic with a % elp:ignore W0093 comment on the line above the first line of code in the header, or disable the linter via [linters.unused_header] enabled = false in the project's .elp_lint.toml.