public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Alan Modra <amodra@gmail.com>
To: "Martin Liška" <mliska@suse.cz>
Cc: Binutils <binutils@sourceware.org>
Subject: Re: Do we support Not ANSI C compiler?
Date: Tue, 10 May 2022 11:14:58 +0930	[thread overview]
Message-ID: <YnnDms5UMAI9DkfP@squeak.grove.modra.org> (raw)
In-Reply-To: <99b5380e-8072-dd67-497d-94f72eee43c3@suse.cz>

On Mon, May 09, 2022 at 10:49:08AM +0200, 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?

I'd like to go further and remove the PTR define entirely, and other
messing with inline and suchlike.  I know we can't do that just yet,
and perhaps never due to other projects that make use of ansidecl.h,
but with that in mind I'm going to commit a series of patches to clean
up binutils.

Here's the first one.

	* hashtab.h (HTAB_EMPTY_ENTRY): Replace PTR with void *.
	(HTAB_DELETED_ENTRY): Likewise.

diff --git a/include/hashtab.h b/include/hashtab.h
index 7117eee2afb..e74d2226e08 100644
--- a/include/hashtab.h
+++ b/include/hashtab.h
@@ -79,12 +79,12 @@ typedef void (*htab_free_with_arg) (void *, void *);
 
 /* This macro defines reserved value for empty table entry.  */
 
-#define HTAB_EMPTY_ENTRY    ((PTR) 0)
+#define HTAB_EMPTY_ENTRY    ((void *) 0)
 
 /* This macro defines reserved value for table entry which contained
    a deleted element. */
 
-#define HTAB_DELETED_ENTRY  ((PTR) 1)
+#define HTAB_DELETED_ENTRY  ((void *) 1)
 
 /* Hash tables are of the following type.  The structure
    (implementation) of this type is not needed for using the hash

-- 
Alan Modra
Australia Development Lab, IBM

  parent reply	other threads:[~2022-05-10  1:45 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
2022-05-10  1:44 ` Alan Modra [this message]
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=YnnDms5UMAI9DkfP@squeak.grove.modra.org \
    --to=amodra@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=mliska@suse.cz \
    /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).