unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Andrea Corallo <acorallo@gnu.org>
To: Drew Adams <drew.adams@oracle.com>
Cc: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
Subject: Re: [External] : Re: Question about native compilation (bug?)
Date: Thu, 27 Jul 2023 13:51:57 -0400	[thread overview]
Message-ID: <yp14jlps0n6.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <SJ0PR10MB5488CC64ED9DC6B3A1053AE8F301A@SJ0PR10MB5488.namprd10.prod.outlook.com> (Drew Adams's message of "Thu, 27 Jul 2023 17:05:35 +0000")

Drew Adams <drew.adams@oracle.com> writes:

>> >> Redefining a primitive (thing that is not recommended but often done)
>> >> one must at least use the same signature as the original one.  I don't
>> >> think we support the case where the new definition is of a different
>> >> signature.  Native compilation might be just more sensitive in this
>> >> unsupported condition.
>> >
>> > I don't know whether the same problem arises if
>> > the redefined function has a Lisp instead of a
>> > C definition.  If not, then what you say might
>> > have a bit more sway.
>> 
>> Should be only about primitives (C definitions).
>
> OK, thx.
>
> What about my other questions, e.g. wrt fixing this?

I haven't done any recent analysis, from what I remember it is not
easily fixable.

That said I think is not worth of, redefining primitives is already
discouraged by the manual and dangerous (more on that later), doing it
with a different signature it's just kamikaze behavior.

Note also that redefining primitives in Emacs is not only disincouraged,
but is really not guaranteed to work properly.  The redefinition will
not take effect executing bytecode if the primitive has a dedicated
byteopcode and it will *not* take effect either for any call to the
primiteve done form C itself.

  Andrea



  reply	other threads:[~2023-07-27 17:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-26 21:32 Question about native compilation (bug?) Drew Adams
2023-07-27  4:45 ` Tassilo Horn
2023-07-27 15:25   ` [External] : " Drew Adams
2023-07-27  9:53 ` Andrea Corallo
2023-07-27 14:37   ` [External] : " Drew Adams
2023-07-27 16:15     ` Andrea Corallo
2023-07-27 17:05       ` Drew Adams
2023-07-27 17:51         ` Andrea Corallo [this message]
2023-07-27 18:14           ` Drew Adams
2023-07-27 18:38             ` Andrea Corallo
2023-07-27 19:11             ` Eli Zaretskii

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/emacs/

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

  git send-email \
    --in-reply-to=yp14jlps0n6.fsf@fencepost.gnu.org \
    --to=acorallo@gnu.org \
    --cc=drew.adams@oracle.com \
    --cc=emacs-devel@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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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