* "possibly unbound variable" with auto compile, but not without or with compile
@ 2020-05-05 19:42 Alexis Fouilhé
0 siblings, 0 replies; only message in thread
From: Alexis Fouilhé @ 2020-05-05 19:42 UTC (permalink / raw)
To: guile-user
Hi list!
I am using Guile to test a C program and I get "possibly unbound variable" warnings about functions defined in C, when running my Guile script with auto-compile on (the default). But I don't get these warnings when compiling with "guild compile", nor when running my Guile script with "guile --no-auto-compile".
I am new to Guile, so I am probably missing something obvious. But I couldn't find, in the reference manual or on the Web, a hint for an explanation or a way to make Guile stop complaining. These warnings make a wall of noise in my test runs, which I would like to get rid of. Would you have any pointers toward making the compiler happy?
The "script" record below shows a minimal example reproducing the issue. I am using Guile 2.2.6 on an up-to-date Ubuntu 19.10 amd64.
Any help will be much appreciated.
Alexis
Script started on 2020-05-05 21:06:33+02:00 [TERM="screen" TTY="/dev/pts/1" COLUMNS="106" LINES="52"]
$ ls
t.c t.scm
$ cat t.c
#include <libguile.h>
SCM f(void) {
return SCM_BOOL_T;
}
void init_t(void) {
scm_c_define_gsubr("f", 0, 0, 0, f);
}
$ cat t.scm
(load-extension "./t.so" "init_t")
(simple-format #t "~A\n" (f))
$ gcc -shared -o t.so -fPIC $(pkg-config --cflags guile-2.2) t.c
$ guile --not-auto-compile t.scm
#t
$ guild compile t.scm
wrote `/home/a/.cache/guile/ccache/2.2-LE-8-3.A/home/a/e/t/t.scm.go'
$ guile t.scm
#t
$ touch t.scm
$ guile t.scm
;;; note: source file /home/a/e/t/t.scm
;;; newer than compiled /home/a/.cache/guile/ccache/2.2-LE-8-3.A/home/a/e/t/t.scm.go
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;; or pass the --no-auto-compile argument to disable.
;;; compiling /home/a/e/t/t.scm
;;; /home/a/e/t/t.scm:3:25: warning: possibly unbound variable `f'
;;; compiled /home/a/.cache/guile/ccache/2.2-LE-8-3.A/home/a/e/t/t.scm.go
#t
$ exit
Script done on 2020-05-05 21:07:28+02:00 [COMMAND_EXIT_CODE="0"]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-05-05 19:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-05 19:42 "possibly unbound variable" with auto compile, but not without or with compile Alexis Fouilhé
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).