c-std-porting.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Armin Rigo <armin.rigo@gmail.com>
To: python-cffi@googlegroups.com
Cc: c-std-porting@lists.linux.dev
Subject: Re: [python-cffi] cffi.FFI.cdef and implicit function declarations
Date: Wed, 8 Feb 2023 13:18:13 +0100	[thread overview]
Message-ID: <CAMSv6X1SYtqD1vHsom8s0xCbqF-K_9EJV4htti0mL9RyqFiyZQ@mail.gmail.com> (raw)
In-Reply-To: <CAMSv6X0-VSeov_EwdVEg2n2HawDspnC9P+b1S-WZW-nRinEaGA@mail.gmail.com>

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.

Armin Rigo

  reply	other threads:[~2023-02-08 12:18 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 [this message]
2023-02-08 13:57     ` Florian Weimer

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:

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

  git send-email \
    --in-reply-to=CAMSv6X1SYtqD1vHsom8s0xCbqF-K_9EJV4htti0mL9RyqFiyZQ@mail.gmail.com \
    --to=armin.rigo@gmail.com \
    --cc=c-std-porting@lists.linux.dev \
    --cc=python-cffi@googlegroups.com \


* 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).