From: "Martin Liška" <mliska@suse.cz>
To: Pedro Alves <pedro@palves.net>, Binutils <binutils@sourceware.org>
Subject: Re: Do we support Not ANSI C compiler?
Date: Mon, 9 May 2022 14:01:29 +0200 [thread overview]
Message-ID: <aeb9cdb1-1f84-c679-c6fc-64b9c29bac8c@suse.cz> (raw)
In-Reply-To: <70918576-c535-0218-720f-24ac44af4091@palves.net>
[-- Attachment #1: Type: text/plain, Size: 822 bytes --]
On 5/9/22 11:22, Pedro Alves wrote:
> On 2022-05-09 09:49, Martin Liška wrote:
>> Hi.
>>
>> I noticed ./include/ansidecl.h contains not ANSI C path:
>>
>> #else /* Not ANSI C. */
>>
>> #define PTR char *
>>
>> /* some systems define these in header files for non-ansi mode */
>> #undef const
>> #undef volatile
>> #undef signed
>> #undef inline
>> #define const
>> #define volatile
>> #define signed
>> #define inline
>>
>> #endif /* ANSI C. */
>>
>> And my question is if we really support such compilers or can we remove the hunk?
>
> Given:
>
> - GCC requires C++11 nowadays,
> - GDB requires C++11 nowadays,
> - Binutils requires C99 nowadays (for over a year),
>
> I'd think that no, we no longer support such compilers and we can remove the hunk.
All right. Thus I've just pushed sync from GCC.
Martin
[-- Attachment #2: 0001-ansidecl.h-sync-from-GCC.patch --]
[-- Type: text/x-patch, Size: 2743 bytes --]
From 35e48b6ee0b244625188f11b27808cefbeeb7666 Mon Sep 17 00:00:00 2001
From: Martin Liska <mliska@suse.cz>
Date: Mon, 9 May 2022 13:59:37 +0200
Subject: [PATCH] ansidecl.h: sync from GCC
include/ChangeLog:
* ansidecl.h: Sync from GCC.
---
include/ansidecl.h | 23 +++--------------------
1 file changed, 3 insertions(+), 20 deletions(-)
diff --git a/include/ansidecl.h b/include/ansidecl.h
index 75bc24c8c07..efee5b6904b 100644
--- a/include/ansidecl.h
+++ b/include/ansidecl.h
@@ -62,7 +62,6 @@ So instead we use the macro below and test it against specific values. */
#define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
#endif /* GCC_VERSION */
-#if defined (__STDC__) || defined(__cplusplus) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(_WIN32)
/* All known AIX compilers implement these things (but don't always
define __STDC__). The RISC/OS MIPS compiler defines these things
in SVR4 mode, but does not define __STDC__. */
@@ -79,7 +78,7 @@ So instead we use the macro below and test it against specific values. */
/* inline requires special treatment; it's in C99, and GCC >=2.7 supports
it too, but it's not in C89. */
#undef inline
-#if __STDC_VERSION__ >= 199901L || defined(__cplusplus) || (defined(__SUNPRO_C) && defined(__C99FEATURES__))
+#if (!defined(__cplusplus) && __STDC_VERSION__ >= 199901L) || defined(__cplusplus) || (defined(__SUNPRO_C) && defined(__C99FEATURES__))
/* it's a keyword */
#else
# if GCC_VERSION >= 2007
@@ -89,22 +88,6 @@ So instead we use the macro below and test it against specific values. */
# endif
#endif
-#else /* Not ANSI C. */
-
-#define PTR char *
-
-/* some systems define these in header files for non-ansi mode */
-#undef const
-#undef volatile
-#undef signed
-#undef inline
-#define const
-#define volatile
-#define signed
-#define inline
-
-#endif /* ANSI C. */
-
/* Define macros for some gcc attributes. This permits us to use the
macros freely, and know that they will come into play for the
version of gcc in which they are supported. */
@@ -356,7 +339,7 @@ So instead we use the macro below and test it against specific values. */
#define ENUM_BITFIELD(TYPE) unsigned int
#endif
-#if __cpp_constexpr >= 200704
+#if defined(__cplusplus) && __cpp_constexpr >= 200704
#define CONSTEXPR constexpr
#else
#define CONSTEXPR
@@ -419,7 +402,7 @@ So instead we use the macro below and test it against specific values. */
so that most attempts at copy are caught at compile-time. */
-#if __cplusplus >= 201103
+#if defined(__cplusplus) && __cplusplus >= 201103
#define DISABLE_COPY_AND_ASSIGN(TYPE) \
TYPE (const TYPE&) = delete; \
void operator= (const TYPE &) = delete
--
2.36.0
next prev parent reply other threads:[~2022-05-09 12:01 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-09 8:49 Martin Liška
2022-05-09 9:22 ` Pedro Alves
2022-05-09 12:01 ` Martin Liška [this message]
2022-05-10 1:44 ` Alan Modra
2022-05-10 1:47 ` bfd: remove use of PTR Alan Modra
2022-05-10 1:49 ` opcodes: " Alan Modra
2022-05-10 1:49 ` gas: " Alan Modra
2022-05-10 1:50 ` gprof: " Alan Modra
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=aeb9cdb1-1f84-c679-c6fc-64b9c29bac8c@suse.cz \
--to=mliska@suse.cz \
--cc=binutils@sourceware.org \
--cc=pedro@palves.net \
/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).