guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

"possibly unbound variable" with auto compile, but not without or with


From: Alexis Fouilhé
Subject: "possibly unbound variable" with auto compile, but not without or with compile
Date: Tue, 05 May 2020 21:42:40 +0200
User-agent: SOGoMail 4.3.0

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"]




reply via email to

[Prev in Thread] Current Thread [Next in Thread]