From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by sourceware.org (Postfix) with ESMTPS id E2D5238485AD for ; Tue, 10 May 2022 01:45:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E2D5238485AD Received: by mail-pl1-x62e.google.com with SMTP id x18so15475389plg.6 for ; Mon, 09 May 2022 18:45:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=s63H5gR5sabhiapjjsHIEgZn3Z5v5eDVM+glt+zuGgs=; b=1gk1uWDpCTsnkqiG+yJPSOdB3PxvdHLZcisXV2PTsXYBOnqvyTD2amaDQrHnoAaxmW LIoGrwMwtA1MTtZ78Ady4qWDLdyDdm0/5kliM0vlsTNJehWrjmzpsiwP/QPFhnnVNhvs Ydg3E9YomQ0asHLZWb3+pFbjYk7c9/zJsql0nQp1HXiWM6Z1vLLB9CMlKfE51Uli2WWo cknQPw3z9H7w9s2QSJFetSU92aY7+idLzq0Bcz8ECvo9N/aMJJU3Z/TnydO6g2tO1L6z SLS3a0l3NLK6H06JY0u990Zy/KphHtoaZh2paTZya/DuYs2SHs2N4KRBQbyJLFD6mnRJ ZO1w== X-Gm-Message-State: AOAM530tQp3S/LKBJUXgE540Q8TD40er6CEfJslOcNQKKuhGVNJtTwx1 Nzg70KbzbBPs3FlgResBWbT6kpgwHDs= X-Google-Smtp-Source: ABdhPJwHBx+MuIjwSFEcMiyhHbF3rt/asiORYsI6qAwO/YewFitTP9WYxgT+MUw8Fml8y0jkix4LEw== X-Received: by 2002:a17:903:41cb:b0:15e:b1f4:352f with SMTP id u11-20020a17090341cb00b0015eb1f4352fmr18588897ple.56.1652147102433; Mon, 09 May 2022 18:45:02 -0700 (PDT) Received: from squeak.grove.modra.org ([2406:3400:51d:8cc0:4e2a:1243:210:2d5c]) by smtp.gmail.com with ESMTPSA id x125-20020a623183000000b0050dc7628198sm9277208pfx.114.2022.05.09.18.45.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 18:45:01 -0700 (PDT) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id AF8E2114215A; Tue, 10 May 2022 11:14:58 +0930 (ACST) Date: Tue, 10 May 2022 11:14:58 +0930 From: Alan Modra To: Martin =?utf-8?B?TGnFoWth?= Cc: Binutils Subject: Re: Do we support Not ANSI C compiler? Message-ID: References: <99b5380e-8072-dd67-497d-94f72eee43c3@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <99b5380e-8072-dd67-497d-94f72eee43c3@suse.cz> X-Spam-Status: No, score=-3036.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 May 2022 01:45:05 -0000 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