ITADN

Compiler warnings

#15Openmattiasb 创建于 2024-11-03
M
mattiasbcommented
The autoloads in projection currently gives me the following compiler warnings whenever I (un-)install a package: ``` package-quickstart.el:4250:87: Warning: reference to free variable ‘projection-project-type-cmake’ package-quickstart.el:4274:87: Warning: reference to free variable ‘projection-project-type-golang’ package-quickstart.el:4285:87: Warning: reference to free variable ‘projection-project-type-gradle’ package-quickstart.el:4299:87: Warning: reference to free variable ‘projection-project-type-make’ package-quickstart.el:4311:87: Warning: reference to free variable ‘projection-project-type-meson’ package-quickstart.el:4323:87: Warning: reference to free variable ‘projection-project-type-npm’ package-quickstart.el:4335:87: Warning: reference to free variable ‘projection-project-type-python-poetry’ package-quickstart.el:4344:93: Warning: reference to free variable ‘projection-project-type-django’ package-quickstart.el:4344:124: Warning: reference to free variable ‘projection-project-type-python-pip’ package-quickstart.el:4344:159: Warning: reference to free variable ‘projection-project-type-python-pkg’ package-quickstart.el:4344:194: Warning: reference to free variable ‘projection-project-type-python-toml’ package-quickstart.el:4344:230: Warning: reference to free variable ‘projection-project-type-python-tox’ package-quickstart.el:4344:265: Warning: reference to free variable ‘projection-project-type-python-pipenv’ package-quickstart.el:4356:87: Warning: reference to free variable ‘projection-project-type-rust-cargo’ package-quickstart.el:4379:87: Warning: reference to free variable ‘projection-project-type-vscode-tasks’ package-quickstart.el:4391:87: Warning: reference to free variable ‘projection-project-type-yarn’ ``` I suspect that the issue is the same for all of them but I dug around a little bit specifically for the `cmake` project type. In `projection-multi-cmake.el` we have: ``` ;;;###autoload (with-eval-after-load 'projection-types (projection-type-append-compile-multi-targets projection-project-type-cmake #'projection-multi-cmake-targets)) ``` The whole `with-eval-after-load` will thus be copied to `package-quickstart.el` verbatim. Unfortunately there's no autoload for `projection-project-type-cmake` which in turn is defined in `projection-types.el` like this: ``` (defvar projection-project-type-cmake (projection-type :name 'cmake :predicate "CMakeLists.txt" :configure #'projection-cmake-run-configure :build #'projection-cmake-run-build :test #'projection-cmake-run-test :install #'projection-cmake-run-install :artifacts-list (list #'projection-cmake-list-artifacts #'projection-ctest-list-artifacts) :test-suffix ".t" :compile-multi-targets `(("cmake:clear" . ,#'projection-cmake-clear-build-directory)))) ``` I *believe* that just adding an empty `defvar` to the above `with-eval-after-load` should solve this: ``` ;;;###autoload (with-eval-after-load 'projection-types (defvar projection-project-type-cmake) (projection-type-append-compile-multi-targets projection-project-type-cmake #'projection-multi-cmake-targets)) ``` What do you think?
2 条评论