unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Tomas Volf <~@wolfsden.cz>
To: guile-user@gnu.org
Subject: warning: possibly unused local top-level variable `%foo?-procedure'
Date: Wed, 5 Jun 2024 17:02:49 +0200	[thread overview]
Message-ID: <ZmB-GZRPhybq0gjt@ws> (raw)

[-- Attachment #1: Type: text/plain, Size: 1272 bytes --]

Hello,

I am getting following warning from a guild compile:

    warning: possibly unused local top-level variable `%foo?-procedure'

And I am not sure how to tackle it.  This is my full source code:

    (define-module (x)
      #:use-module (srfi srfi-9)
      #:export (<foo>
                foo?
                make-foo))

    (define-record-type <foo> (make-foo) foo?)

When I try to compile it:

    $ guild compile -W 3 -o x.go x.scm
    x.scm:7:0: warning: possibly unused local top-level variable `%foo?-procedure'
    wrote `x.go'

I would (for obvious reasons) like to keep my compilation warning-free.  I can
think of two approaches:

1. Export the %foo?-procedure
     I think this would confuse downstream users, since they are not expected to
     use it directly.

2. Mark the procedure as used
      In C I could use `(void)proc;', is there an equivalent of that construct
      in Guile?

Are there other options?  How are you approaching it?

Thank you and have a nice day,
Tomas Volf

PS: I am not even sure why this warning happens, the `foo?' syntax transformer
is exported and *does* reference it (as far as I can tell from ,expand).

--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

             reply	other threads:[~2024-06-05 15:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-05 15:02 Tomas Volf [this message]
2024-06-06 20:02 ` warning: possibly unused local top-level variable `%foo?-procedure' Linus Björnstam
2024-06-06 22:52   ` Tomas Volf
2024-06-07  7:26     ` Linus Björnstam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZmB-GZRPhybq0gjt@ws \
    --to=~@wolfsden.cz \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).