From: Siddhesh Poyarekar <siddhesh@redhat.com>
To: Florian Weimer <fweimer@redhat.com>
Cc: libc-alpha@sourceware.org
Subject: Re: C90 header compatibility
Date: Mon, 30 Jan 2023 07:26:34 -0500 [thread overview]
Message-ID: <CAAmeS-bpKyedFkK7OV5tiHLqU01W_3Xb3U-p0OXeKx5tysdk-w@mail.gmail.com> (raw)
In-Reply-To: <871qnc1mjo.fsf@oldenburg.str.redhat.com>
On Mon, Jan 30, 2023 at 2:58 AM Florian Weimer <fweimer@redhat.com> wrote:
>
> We regressed compatibility with C90 compilers because <sys/cdefs.h>
> unconditionally uses variadic macros, a C99 feature, in the definition
> of __glibc_fortify and __glibc_fortify_n.
>
> This also impacts certain C++ compilers that do not have a
> C99-compatible preprocessor.
>
> Should we fix this? I think so.
>
> Previously, we worked around this by enclosing variable-length lists in
> (…), but it doesn't look like it might work here. We probably need to
> move the macros into a separate file, and include that file only if
> fortification is active.
Wouldn't conditionalizing the macro defs in-place with #if
__FORTIFY_LEVEL > 0 sufficient? __FORTIFY_LEVEL can be non-zero only
for gcc 4.1 or newer. That is, do these older compilers complain if
there's code they cannot recognize in a #if 0 block?
Sid
next prev parent reply other threads:[~2023-01-30 12:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-30 7:58 Florian Weimer
2023-01-30 12:26 ` Siddhesh Poyarekar [this message]
2023-01-30 12:43 ` Florian Weimer
2023-01-30 13:32 ` [PATCH] cdefs: Limit definition of fortification macros Siddhesh Poyarekar
2023-02-01 17:48 ` 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:
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=CAAmeS-bpKyedFkK7OV5tiHLqU01W_3Xb3U-p0OXeKx5tysdk-w@mail.gmail.com \
--to=siddhesh@redhat.com \
--cc=fweimer@redhat.com \
--cc=libc-alpha@sourceware.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).