c-std-porting.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Armin Rigo <armin.rigo@gmail.com>
Cc: python-cffi@googlegroups.com,  c-std-porting@lists.linux.dev
Subject: Re: [python-cffi] cffi.FFI.cdef and implicit function declarations
Date: Wed, 08 Feb 2023 14:57:08 +0100	[thread overview]
Message-ID: <87k00smf9n.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <CAMSv6X1SYtqD1vHsom8s0xCbqF-K_9EJV4htti0mL9RyqFiyZQ@mail.gmail.com> (Armin Rigo's message of "Wed, 8 Feb 2023 13:18:13 +0100")

* Armin Rigo:

> Hi again,
>
> On Wed, 8 Feb 2023 at 13:12, Armin Rigo <armin.rigo@gmail.com> wrote:
>> make the declared functions available to the C code.  A typical usage
>> is to say ffi.verify('#include <something.h>').  If you are getting an
>> "implicit function" warning from the C compiler, then this was not
>> done correctly.
>
> ...In other words, if changes to the C compiler replaces these
> warnings with errors, and this breaks old existing code, then that old
> code was broken in the first place for relying on that feature.  I
> don't think there is something to say about that specifically for
> CFFI's old verify() API.  I think the problem is the same as people will
> encounter with old, manually-written C code which was broken the same way.
> The fix is to add the missing #include in both cases.  For ffi.verify()
> it is added in the first argument, which is copied into the generated C code.

Okay, this is good to know.  Thank you for taking the time to explain
it.

Florian


      reply	other threads:[~2023-02-08 13:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-08 10:10 cffi.FFI.cdef and implicit function declarations Florian Weimer
2023-02-08 12:12 ` [python-cffi] " Armin Rigo
2023-02-08 12:18   ` Armin Rigo
2023-02-08 13:57     ` Florian Weimer [this message]

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

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

  git send-email \
    --in-reply-to=87k00smf9n.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=armin.rigo@gmail.com \
    --cc=c-std-porting@lists.linux.dev \
    --cc=python-cffi@googlegroups.com \
    /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 NNTP newsgroup(s).