public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/105863] RFE: C23 #embed
Date: Wed, 15 May 2024 15:33:24 +0000	[thread overview]
Message-ID: <bug-105863-4-48Az3YVfyh@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-105863-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105863

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
_Embed opens the pandorra box what should happen when you stringify it or try
to token paste it together with something else etc.

Anyway, for GCC implementation of what C23 specifies, I wonder if we shouldn't
implement it in separate steps, first in a dumb way of just expanding it always
into preprocessor token, a path that could perhaps then be kept for the smaller
sizes when it isn't worth doing something smart.
And only in the second step try to add optimizations to it (guess for C those
could be easier than for C++ because C doesn't try to tokenize everything
first, so for C when we peek at the large embed token outside of the language
contexts where we know how to handle those (e.g. most importantly inside of
aggregate initializers) we could simply replace the token with expanded form of
it, say if one uses
void foo (...);
void bar ()
{
  foo (
#embed "foo_arguments"
  );
}
it would work without having to bother too much about that specific case.
The LLVM current pull request for this is
https://github.com/llvm/llvm-project/pull/68620
I think we should try to use same options where reasonable.

  parent reply	other threads:[~2024-05-15 15:33 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-06 16:52 [Bug c/105863] New: RFE: __attribute__((incbin("file"))) or __builtin_incbin("file") hpa at zytor dot com
2022-06-06 17:36 ` [Bug c/105863] " pinskia at gcc dot gnu.org
2022-06-06 17:43 ` amonakov at gcc dot gnu.org
2022-06-13 12:59 ` rguenth at gcc dot gnu.org
2023-06-05 19:55 ` [Bug c/105863] RFE: C23 #embed hpa at zytor dot com
2023-06-22 15:16 ` mpolacek at gcc dot gnu.org
2023-06-22 20:42 ` joseph at codesourcery dot com
2024-05-15 15:33 ` jakub at gcc dot gnu.org [this message]
2024-05-15 16:16 ` hpa at zytor dot com
2024-05-16 20:41 ` jsm28 at gcc dot gnu.org
2024-05-17 12:08 ` jakub at gcc dot gnu.org
2024-05-20 20:35 ` jsm28 at gcc dot gnu.org
2024-06-11 15:01 ` jakub at gcc dot gnu.org
2024-06-13 14:45 ` jakub at gcc dot gnu.org
2024-06-14  8:19 ` jakub at gcc dot gnu.org
2024-06-14 19:35 ` jakub at gcc dot gnu.org

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=bug-105863-4-48Az3YVfyh@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.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).