From: Michael Forney <mforney@mforney.org>
To: gcc-patches@gcc.gnu.org
Subject: [PATCH] libiberty: Don't use VLAs if __STDC_NO_VLA__ is non-zero
Date: Thu, 30 May 2019 20:54:00 -0000 [thread overview]
Message-ID: <20190530205055.21215-1-mforney@mforney.org> (raw)
VLAs are optional in C11, and an implementation that does not support
them will define __STDC_NO_VLA__ to 1.
2019-05-30 Michael Forney <mforney@mforney.org>
* cp-demangle.c: Don't define CP_DYNAMIC_ARRAYS if __STDC_NO_VLA__
is non-zero.
---
libiberty/cp-demangle.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c
index 4e5b733b548..aa78c86dd44 100644
--- a/libiberty/cp-demangle.c
+++ b/libiberty/cp-demangle.c
@@ -192,9 +192,9 @@ static void d_init_info (const char *, int, size_t, struct d_info *);
#else
#ifdef __STDC__
#ifdef __STDC_VERSION__
-#if __STDC_VERSION__ >= 199901L
+#if __STDC_VERSION__ >= 199901L && !__STDC_NO_VLA__
#define CP_DYNAMIC_ARRAYS
-#endif /* __STDC__VERSION >= 199901L */
+#endif /* __STDC_VERSION__ >= 199901L && !__STDC_NO_VLA__ */
#endif /* defined (__STDC_VERSION__) */
#endif /* defined (__STDC__) */
#endif /* ! defined (__GNUC__) */
--
2.20.1
next reply other threads:[~2019-05-30 20:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-30 20:54 Michael Forney [this message]
2019-05-31 18:46 ` Jeff Law
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=20190530205055.21215-1-mforney@mforney.org \
--to=mforney@mforney.org \
--cc=gcc-patches@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).