Skip to content
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

Byte compile produces warnings for unknown functions #165

Closed
Forge36 opened this issue Jun 2, 2024 · 3 comments
Closed

Byte compile produces warnings for unknown functions #165

Forge36 opened this issue Jun 2, 2024 · 3 comments

Comments

@Forge36
Copy link

Forge36 commented Jun 2, 2024

 ■  Warning (comp): citeproc-s.el:240:21: Warning: the function ‘citeproc-s-replace’ is not known to be defined.
 ■  Warning (comp): citeproc-lib.el:159:33: Warning: the function ‘citeproc-rt-render-affixes’ is not known to be defined.
 ■  Warning (comp): citeproc-lib.el:154:55: Warning: the function ‘citeproc-context-vars’ is not known to be defined.
 ■  Warning (comp): citeproc-rt.el:538:25: Warning: the function ‘citeproc-itemdata-rawbibitem’ is not known to be defined.
 ■  Warning (comp): citeproc-prange.el:40:44: Warning: the function ‘citeproc-s-fill-copy’ is not known to be defined.
 ■  Warning (comp): citeproc-date.el:271:13: Warning: the function ‘citeproc-number--format-as-ordinal’ is not known to be defined.
 ■  Warning (comp): citeproc-formatters.el:384:48: Warning: the function ‘citeproc-rt-to-plain’ is not known to be defined.
 ■  Warning (comp): citeproc-formatters.el:164:21: Warning: the function ‘citeproc-s-replace-all-seq’ is not known to be defined.
 ■  Warning (comp): citeproc-sort.el:90:19: Warning: the function ‘citeproc-number-var-value’ is not known to be defined.
@andras-simonyi
Copy link
Owner

Hello, thanks for reporting! Could you describe in detail how you are trying to compile the program? (Operating System, Emacs version, with or without an init file?) If you are compiling with an init file then it would also be useful to try to reproduce the problem without one, e.g., using the "-q" switch when starting Emacs.

@Forge36
Copy link
Author

Forge36 commented Jun 16, 2024

To my knowledge the native compilation is automatic (provide emacs is built with support). I'm not able to trigger this error directly with byte-recompile-file

System details:

I have an init file
(emacs-version)
GNU Emacs 29.3 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 1.16.0) of 2024-05-10

OS Windows 10 in WSL (Ubuntu 22.04.4 LTS)

Some testing to reproduce:
I modify citeproc-sort.el restart emacs, and insert a citation in org triggers the async-compile.
I can then "fix" the citeproc-sort.el warning by adding (require 'citeproc-number).

I'm not having luck using emacs -q to produce a minimal test case unfortunately (I'm struggling to use emacs in that scenario). These warnings appear to only display on the native compile (which occurs after a restart of emacs in my instance).

I'm going to poke at an MR to address these if I can determine how (I'm new to upstreaming fixes apologies if I'm not following proper etiquette).

Edit:
Found the docs on fixing these

https://www.gnu.org/software/emacs/manual/html_node/elisp/Declaring-Functions.html

I've usually seen these resolved with (require 'package') (which is how I based my draft MR). Given there aren't any known errors/issues that suggests the use of (declare-function <function> "<package>" ()). I can use this method to resolve the warnings without risking behavior changes.

Edit 2:
Draft MR is up-to-date. Let me know what changes you'd like.

@Forge36
Copy link
Author

Forge36 commented Jun 21, 2024

This appears fixed with the latest #169!

Closing

@Forge36 Forge36 closed this as completed Jun 21, 2024
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 a pull request may close this issue.

2 participants