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
Fix byte-compilation warnings (again) #79
Comments
I noticed myself some fontification tests failing, and looking into why, it seems I've accidentally removed some functions which are definitely still referenced. Wonder how I managed to miss that. I say step one for this issue should be restoring the missing defuns which are still referenced. I've already done one bit there in this commit: |
Removes compiler warning about undefined variables. Addresses #79
Right now the following compilation warnings remain: $ make clean && make csharp-mode.elc
...
In end of data:
csharp-mode.el:2963:1:Warning: the following functions might not be defined at
runtime: c-skip-comments-and-strings, c-font-lock-invalid-string,
c-font-lock-declarators, c-fontify-recorded-types-and-refs,
c-define-abbrev-table, c-make-inherited-keymap, c-initialize-cc-mode,
c-populate-syntax-table, c-common-init
csharp-mode.el:2963:1:Warning: the following functions are not known to be
defined: csharp-log, csharp-is-square-parentasis-block-p
Wrote /home/jostein/build/csharp-mode/csharp-mode.elc They are defined though, and earlier in the file than any of it's immediate callers, so it's looks like we have some sort of issue with evaluation order (due to a million Running the test-suite all is fine too: $ make clean && make all
...
csharp-mode.el:2963:1:Warning: the following functions are not known to be
defined: csharp-log, csharp-is-square-parentasis-block-p
...
Ran 21 tests, 21 results as expected (2016-06-02 15:30:02+0200) Wrapping these the two functions $ make clean && make all
...
Test fontification-of-method-names condition:
(void-function csharp-is-square-parentasis-block-p)
FAILED 9/21 fontification-of-method-names
...
Ran 21 tests, 20 results as expected, 1 unexpected (2016-06-02 15:31:52+0200)
1 unexpected results:
FAILED fontification-of-method-names If we try to run the tests without pre-compiling, they work too: $ make clean && make test
rm -f ../csharp-mode-0.9.0.tar
rm -rf ./.tmp/csharp-mode-0.9.0
rm -rf csharp-mode.elc csharp-mode-tests.elc
"/usr/bin/emacs" -Q -batch -L . -l csharp-mode-tests.el -f ert-run-tests-batch-and-exit
Running 21 tests (2016-06-02 15:32:44+0200)
passed 1/21 activating-mode-doesnt-cause-failure
...
passed 21/21 indentation-rules-should-be-as-specified-in-test-doc
Ran 21 tests, 21 results as expected (2016-06-02 15:32:45+0200) Basically the compilation-process is eating our defuns. One hack around that is to define the functions and then redundantly define them in |
Hm, so reordering doesn't do anything about it. Time to learn what these special forms do and why they're needed in the first place... |
My latest push fixes everything we're responsible for, but we're still getting the nasty stuff from What I tried first was I've tried various approaches to silence the remaining Right now we have the following output:
Is that good enough to close this issue, or do we dig even further? |
I spoke too early and forgot to do Not sure where we go from here. |
I did a git bisect on this thing, because I know we had it fixed properly at some point. Below is the output, and I guess I should feel guilty :)
Based on this, I'll try to get things fixed. But at the same time, I'd also love for the build process to fail if stuff like this happens again. Unresolvable functions are not cool. I'll create a separate issue for that. |
Issue with square parenthesis defun is now fixed. Remaining is csharp-log and then this issue can be closed. @wasamasa : A git bisect identifies you as the guilty party for this one. You fix? :)
|
Oh damnit. Well, if it's been the removal of unused code, I'll be able to find out what part of it has been still in use after all. |
Weird, I do no longer get a warning about the log warning on HEAD. |
For whatever reason, moving them up caused the following issue: #79. Moving them back down seems to fix it.
I removed my hacks which was used to mask the problem, and undid the "move log functions to the top" part of your commit, and that seems to have fixed it. Basically moving the log-functions further to the top, caused compiler warnings about them not being defined. For now, we can consider this issue fixed, but we clearly have some very very weird evaluation order going on here... |
Wow, that sure seems weird. My compilation log looks like this at the moment:
|
Yeah. Same as me. I seemed to remember that we never managed to get rid of those final warnings, so I didn't bother bisecting further. Or do I remember incorrectly? Would you bother checking out how much managed to clean this up before we had this regression? |
I get similar output on 69d95d2. so I'm closing this one. |
This is a "take 1" on a csharp-mode with as few (eval-when-compile) and (eval-and-compile) forms as possible. Not only is it a source of confusion, but it also introduces "soft" dependencies which cannot be resolved by the byte-compilation system and this causes compilation warnings. All in all, the changes should be fairly unintrusive, and we still have an issue with our fairly icky (c-lang-defconst), but all the tests pass and things still seem to work as they should. This commit adresses the remaining warnings found in: #79
It looks as if there've been introduced new ones after the huge cleanup:
csharp-log-level
is introduced after the function using it. Perhaps it's better to put customizables right at the top, like in many other packages. Alternatively, put the relevant customizables before the section using them.eval-and-compile
or something of that kindcsharp-is-square-parentasis-block-p
is a really terrible typo and the function definition should precede thec-defconst
csharp--on-defun-open-curly-p
is no more, probably removed along with the other curly predicates. Maybe it's time to actually try out these commands and rewrite them if terrible/improvableThe text was updated successfully, but these errors were encountered: