public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Remove non-ANSI C macros in ansidecl.h.
@ 2022-05-10  8:57 Martin Liška
  2022-05-10  9:55 ` Andreas Schwab
  2022-05-10 14:09 ` Alan Modra
  0 siblings, 2 replies; 5+ messages in thread
From: Martin Liška @ 2022-05-10  8:57 UTC (permalink / raw)
  To: gcc-patches, Binutils

Patch can bootstrap on x86_64-linux-gnu and survives regression tests.

@Alan: Are you fine with the change from binutils/gdb perspective?

Thanks,
Martin

include/ChangeLog:

	* ansidecl.h (PTR): Remove.
	(const): Likewise.
	(volatile): Likewise.
	(signed): Likewise.
---
 include/ansidecl.h | 26 +-------------------------
 1 file changed, 1 insertion(+), 25 deletions(-)

diff --git a/include/ansidecl.h b/include/ansidecl.h
index efee5b6904b..76ff868a128 100644
--- a/include/ansidecl.h
+++ b/include/ansidecl.h
@@ -16,18 +16,7 @@ You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
 
-/* ANSI and traditional C compatibility macros
-
-   ANSI C is assumed if __STDC__ is #defined.
-
-   Macro		ANSI C definition	Traditional C definition
-   -----		---- - ----------	----------- - ----------
-   PTR			`void *'		`char *'
-   const		not defined		`'
-   volatile		not defined		`'
-   signed		not defined		`'
-
-   For ease of writing code which uses GCC extensions but needs to be
+/* For ease of writing code which uses GCC extensions but needs to be
    portable to other compilers, we provide the GCC_VERSION macro that
    simplifies testing __GNUC__ and __GNUC_MINOR__ together, and various
    wrappers around __attribute__.  Also, __extension__ will be #defined
@@ -62,19 +51,6 @@ So instead we use the macro below and test it against specific values.  */
 #define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
 #endif /* GCC_VERSION */
 
-/* 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__.  */
-/* eraxxon@alumni.rice.edu: The Compaq C++ compiler, unlike many other
-   C++ compilers, does not define __STDC__, though it acts as if this
-   was so. (Verified versions: 5.7, 6.2, 6.3, 6.5) */
-
-#define PTR		void *
-
-#undef const
-#undef volatile
-#undef signed
-
 /* inline requires special treatment; it's in C99, and GCC >=2.7 supports
    it too, but it's not in C89.  */
 #undef inline
-- 
2.36.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Remove non-ANSI C macros in ansidecl.h.
  2022-05-10  8:57 [PATCH] Remove non-ANSI C macros in ansidecl.h Martin Liška
@ 2022-05-10  9:55 ` Andreas Schwab
  2022-05-10 10:51   ` Martin Liška
  2022-05-10 14:09 ` Alan Modra
  1 sibling, 1 reply; 5+ messages in thread
From: Andreas Schwab @ 2022-05-10  9:55 UTC (permalink / raw)
  To: Martin Liška; +Cc: gcc-patches, Binutils, Alan Modra

The header line should probably be changed since it's no longer about
ANSI or traditional C.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Remove non-ANSI C macros in ansidecl.h.
  2022-05-10  9:55 ` Andreas Schwab
@ 2022-05-10 10:51   ` Martin Liška
  0 siblings, 0 replies; 5+ messages in thread
From: Martin Liška @ 2022-05-10 10:51 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: gcc-patches, Binutils, Alan Modra

[-- Attachment #1: Type: text/plain, Size: 169 bytes --]

On 5/10/22 11:55, Andreas Schwab wrote:
> The header line should probably be changed since it's no longer about
> ANSI or traditional C.
> 

Sure, updated in v2.

Martin

[-- Attachment #2: 0001-Remove-non-ANSI-C-macros-in-ansidecl.h.patch --]
[-- Type: text/x-patch, Size: 2463 bytes --]

From 9359921cd29f9ec4f7536f49160ad54b74e0214a Mon Sep 17 00:00:00 2001
From: Martin Liska <mliska@suse.cz>
Date: Tue, 10 May 2022 09:47:08 +0200
Subject: [PATCH] Remove non-ANSI C macros in ansidecl.h.

include/ChangeLog:

	* ansidecl.h (PTR): Remove.
	(const): Likewise.
	(volatile): Likewise.
	(signed): Likewise.
---
 include/ansidecl.h | 28 ++--------------------------
 1 file changed, 2 insertions(+), 26 deletions(-)

diff --git a/include/ansidecl.h b/include/ansidecl.h
index efee5b6904b..8fc858cad7e 100644
--- a/include/ansidecl.h
+++ b/include/ansidecl.h
@@ -1,4 +1,4 @@
-/* ANSI and traditional C compatability macros
+/* Compiler compatability macros
    Copyright (C) 1991-2022 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -16,18 +16,7 @@ You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
 
-/* ANSI and traditional C compatibility macros
-
-   ANSI C is assumed if __STDC__ is #defined.
-
-   Macro		ANSI C definition	Traditional C definition
-   -----		---- - ----------	----------- - ----------
-   PTR			`void *'		`char *'
-   const		not defined		`'
-   volatile		not defined		`'
-   signed		not defined		`'
-
-   For ease of writing code which uses GCC extensions but needs to be
+/* For ease of writing code which uses GCC extensions but needs to be
    portable to other compilers, we provide the GCC_VERSION macro that
    simplifies testing __GNUC__ and __GNUC_MINOR__ together, and various
    wrappers around __attribute__.  Also, __extension__ will be #defined
@@ -62,19 +51,6 @@ So instead we use the macro below and test it against specific values.  */
 #define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
 #endif /* GCC_VERSION */
 
-/* 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__.  */
-/* eraxxon@alumni.rice.edu: The Compaq C++ compiler, unlike many other
-   C++ compilers, does not define __STDC__, though it acts as if this
-   was so. (Verified versions: 5.7, 6.2, 6.3, 6.5) */
-
-#define PTR		void *
-
-#undef const
-#undef volatile
-#undef signed
-
 /* inline requires special treatment; it's in C99, and GCC >=2.7 supports
    it too, but it's not in C89.  */
 #undef inline
-- 
2.36.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Remove non-ANSI C macros in ansidecl.h.
  2022-05-10  8:57 [PATCH] Remove non-ANSI C macros in ansidecl.h Martin Liška
  2022-05-10  9:55 ` Andreas Schwab
@ 2022-05-10 14:09 ` Alan Modra
  2022-05-10 14:10   ` Martin Liška
  1 sibling, 1 reply; 5+ messages in thread
From: Alan Modra @ 2022-05-10 14:09 UTC (permalink / raw)
  To: Martin Liška; +Cc: gcc-patches, Binutils

On Tue, May 10, 2022 at 10:57:47AM +0200, Martin Liška wrote:
> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
> 
> @Alan: Are you fine with the change from binutils/gdb perspective?

I'm fine if this isn't going into the binutils-gdb repo immediately.
There are occurrences of PTR in the cgen generated parts of opcodes,
sim, and even gdb.  I have a few patches I haven't yet committed.

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Remove non-ANSI C macros in ansidecl.h.
  2022-05-10 14:09 ` Alan Modra
@ 2022-05-10 14:10   ` Martin Liška
  0 siblings, 0 replies; 5+ messages in thread
From: Martin Liška @ 2022-05-10 14:10 UTC (permalink / raw)
  To: Alan Modra; +Cc: gcc-patches, Binutils

On 5/10/22 16:09, Alan Modra wrote:
> On Tue, May 10, 2022 at 10:57:47AM +0200, Martin Liška wrote:
>> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
>>
>> @Alan: Are you fine with the change from binutils/gdb perspective?
> 
> I'm fine if this isn't going into the binutils-gdb repo immediately.

Sure.

I've just installed the change:
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=137da38377eb4ff53a71b199802a22d28c12d077

> There are occurrences of PTR in the cgen generated parts of opcodes,
> sim, and even gdb.  I have a few patches I haven't yet committed.

So once you're done, please pull the referenced commit change.

Cheers,
Martin


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-05-10 14:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-10  8:57 [PATCH] Remove non-ANSI C macros in ansidecl.h Martin Liška
2022-05-10  9:55 ` Andreas Schwab
2022-05-10 10:51   ` Martin Liška
2022-05-10 14:09 ` Alan Modra
2022-05-10 14:10   ` Martin Liška

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).