From: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
To: Nick Desaulniers <ndesaulniers@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Luc Van Oostenryck <luc.vanoostenryck@gmail.com>,
Nathan Chancellor <natechancellor@gmail.com>,
linux-sparse@vger.kernel.org,
linux-kernel <linux-kernel@vger.kernel.org>,
clang-built-linux <clang-built-linux@googlegroups.com>
Subject: Re: [PATCH] compiler.h: avoid escaped section names
Date: Tue, 29 Sep 2020 23:33:10 +0200 [thread overview]
Message-ID: <CANiq72kHEhTm3-7WbZwmoKQV5Qn9fD_sk+yrVrdj_K0AqT6dNQ@mail.gmail.com> (raw)
In-Reply-To: <20200929194318.548707-1-ndesaulniers@google.com>
Hi Nick,
On Tue, Sep 29, 2020 at 9:43 PM Nick Desaulniers
<ndesaulniers@google.com> wrote:
>
> The stringification operator, `#`, in the preprocessor escapes strings.
> For example, `# "foo"` becomes `"\"foo\""`. GCC and Clang differ in how
> they treat section names that contain \".
>
> The portable solution is to not use a string literal with the
> preprocessor stringification operator.
>
> In this case, since __section unconditionally uses the stringification
> operator, we actually want the more verbose
> __attribute__((__section__())).
Let's add a comment about this in the code -- otherwise we/someone
will convert it back without noticing. Also we could add another on
`__section` itself warning about this.
> Link: https://bugs.llvm.org/show_bug.cgi?id=42950
Is there a link / have we opened a bug on GCC's side too?
Thanks!
Cheers,
Miguel
next prev parent reply other threads:[~2020-09-29 21:38 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-29 19:43 [PATCH] compiler.h: avoid escaped section names Nick Desaulniers
2020-09-29 20:08 ` Arvind Sankar
2020-09-29 20:13 ` Arvind Sankar
2020-09-29 20:25 ` Nick Desaulniers
2020-09-29 20:30 ` Nick Desaulniers
2020-09-29 20:47 ` Arvind Sankar
2020-09-29 20:59 ` Nick Desaulniers
2020-09-30 15:40 ` Joe Perches
2020-09-30 18:33 ` Joe Perches
2020-09-30 23:10 ` convert_section.pl attached Joe Perches
2020-09-29 21:33 ` Miguel Ojeda [this message]
2020-09-30 8:33 ` [PATCH] compiler.h: avoid escaped section names David Laight
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=CANiq72kHEhTm3-7WbZwmoKQV5Qn9fD_sk+yrVrdj_K0AqT6dNQ@mail.gmail.com \
--to=miguel.ojeda.sandonis@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=clang-built-linux@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sparse@vger.kernel.org \
--cc=luc.vanoostenryck@gmail.com \
--cc=natechancellor@gmail.com \
--cc=ndesaulniers@google.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).