From patchwork Thu Dec 7 18:19:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yaakov Selkowitz X-Patchwork-Id: 121066 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp8702366qgn; Thu, 7 Dec 2017 10:28:28 -0800 (PST) X-Google-Smtp-Source: AGs4zMZY1NhzOpzSJ0Xt6ku1Cw+bIFAreqbBFWgCdhJYsBqcmkEUmlPVpssyDdzhWgvj89PLbWrJ X-Received: by 10.101.98.83 with SMTP id q19mr25597164pgv.71.1512671308790; Thu, 07 Dec 2017 10:28:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512671308; cv=none; d=google.com; s=arc-20160816; b=S30UZ/876Vh34xAa7S0m2JQ4STR4mNl+MYTtkiH+U17TIA2EoLWZ0Gbqu7BenPwuVj 8LPssrUwmekvbCBmB1GgaGTFqS7WROEDPN1z7aMWZDn+bZGgvR+faHTRRB8zUeV8Mvhj rdXZ15Ix0O1/39tNMIWM6uIFi2hPVkHk+O7QQUpWrbjjNnTBT5CRFj/gXR6uyYgYWDCx PD0uMu61pQRiNCa2McNhmT48bN3zR70vfh9MtvUmFlJFKdTNjgis2mxiLyfWa5xPBn8w PA0duTsqceSd0rJHKFb4dFG5RSFGVS3AXJy+nrJvmrR/SzjmqemSCRFl53WdNTvRvh7o l6Tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:to:from:delivered-to :sender:list-help:list-post:list-archive:list-subscribe :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature:arc-authentication-results; bh=/fiug48WtaOmzRNCFD8Pu/GjjOv0R0BKjo5++bIF8Bk=; b=JiEJR5yGtHpjYePqSpqO6InBUN94FH+d52/il8ythLCZlccvOPdqChDFHp8uB3ldYJ KReQLYfhCiRQUfGT6VSkOC49iR/vfeHXmgQybyi7sMEQnzDqelqs811KbFUmaXKPeKBh 4s1oBcOJ/43rQOBWInpEJHFxKC7ppkbCS84/oFeRGybF3Pqk1/h75J3mbAWmSJvwMYdv MO3o6gdedo3nRnYhGcwEdHZXgE0ib8uNjGVN7h6wfBai4d84WElhUAJ2vDilqHyH6bMD dNINwIfu2I08YtjzvpRO6aU4GvOtg4Y5BKcqdzCRt+4oi+9X/fg8u/DPavrMkElJywmX fLFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=Phg1P5Gd; spf=pass (google.com: domain of newlib-return-15500-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=newlib-return-15500-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id b91si4126064plb.559.2017.12.07.10.28.28 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Dec 2017 10:28:28 -0800 (PST) Received-SPF: pass (google.com: domain of newlib-return-15500-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=Phg1P5Gd; spf=pass (google.com: domain of newlib-return-15500-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=newlib-return-15500-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=gpp3pBlalGYQZq/pItFAcQBSW50P5v6 XujmGlzCCxGt1ZfhrjOnS9YBF2zbjI+Yr8eJAY5wzCqkdH0SSRGrXazOPwAR/tbn 2UA6HZ/4Y974IXbgHYp/MulDiCHGsB0ESZcKr6rTQUrXa6mUvcOKQqlHYu+95VoV AoiMagrZCK0Y= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; s=default; bh=88+Mv2ueAXRZhm0UYLsJ7NxMy94=; b=Phg1P 5GdDxz3V2MljWgH9ZydmJ0GgRK8dThsBcN5+zwwlq+AVToyBgYQjli3zZmfwkJXV 68T+IjEE9hOvNv6dMp0oo7YE/h2GwQAN2qqMVq71GtzzSXgDobV1++pWnPmk5DMX hRlgezQzBDQ7Ai5A4v5oLR2i98hhurT6QlbrKg= Received: (qmail 34297 invoked by alias); 7 Dec 2017 18:28:14 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Delivered-To: mailing list newlib@sourceware.org Received: (qmail 34285 invoked by uid 89); 7 Dec 2017 18:28:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, SPF_HELO_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=Ave X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 07 Dec 2017 18:28:10 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A6A85C0587C9 for ; Thu, 7 Dec 2017 18:20:11 +0000 (UTC) Received: from localhost.localdomain (ovpn-120-70.rdu2.redhat.com [10.10.120.70]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A01337D8EE for ; Thu, 7 Dec 2017 18:20:10 +0000 (UTC) From: Yaakov Selkowitz To: newlib@sourceware.org Subject: [PATCH v2 15/17] ansification: remove _HAVE_STDC Date: Thu, 7 Dec 2017 12:19:07 -0600 Message-Id: <20171207181909.1112-16-yselkowi@redhat.com> In-Reply-To: <20171207181909.1112-1-yselkowi@redhat.com> References: <20171207181909.1112-1-yselkowi@redhat.com> Signed-off-by: Yaakov Selkowitz --- libgloss/sparc_leon/console_dbg.c | 4 ---- newlib/doc/ansidecl.h | 21 --------------------- newlib/libc/include/_ansi.h | 19 +------------------ newlib/libc/include/machine/fastmath.h | 2 -- newlib/libc/machine/powerpc/vfprintf.c | 4 ---- newlib/libc/machine/powerpc/vfscanf.c | 4 ---- newlib/libc/machine/spu/vfprintf.c | 4 ---- newlib/libc/machine/spu/vfscanf.c | 4 ---- newlib/libc/machine/spu/vprintf.c | 4 ---- newlib/libc/machine/spu/vscanf.c | 4 ---- newlib/libc/machine/spu/vsnprintf.c | 4 ---- newlib/libc/machine/spu/vsprintf.c | 4 ---- newlib/libc/machine/spu/vsscanf.c | 4 ---- newlib/libc/posix/execl.c | 11 ----------- newlib/libc/posix/execle.c | 11 ----------- newlib/libc/posix/execlp.c | 11 ----------- newlib/libc/stdio/fiscanf.c | 27 --------------------------- newlib/libc/stdio/fscanf.c | 27 --------------------------- newlib/libc/stdio/iscanf.c | 25 ------------------------- newlib/libc/stdio/scanf.c | 25 ------------------------- newlib/libc/stdio/siprintf.c | 27 --------------------------- newlib/libc/stdio/siscanf.c | 29 ----------------------------- newlib/libc/stdio/sniprintf.c | 29 ----------------------------- newlib/libc/stdio/snprintf.c | 29 ----------------------------- newlib/libc/stdio/sprintf.c | 27 --------------------------- newlib/libc/stdio/sscanf.c | 29 ----------------------------- newlib/libc/stdio/viprintf.c | 4 ---- newlib/libc/stdio/viscanf.c | 4 ---- newlib/libc/stdio/vprintf.c | 4 ---- newlib/libc/stdio/vscanf.c | 4 ---- newlib/libc/stdio/vsiscanf.c | 4 ---- newlib/libc/stdio/vsscanf.c | 4 ---- newlib/libc/stdio/vswscanf.c | 4 ---- newlib/libc/stdio/vwscanf.c | 4 ---- newlib/libc/stdlib/std.h | 6 ------ newlib/libc/syscalls/sysopen.c | 13 ------------- newlib/libm/math/wf_acos.c | 5 ----- 37 files changed, 1 insertion(+), 444 deletions(-) -- 2.15.1 diff --git a/libgloss/sparc_leon/console_dbg.c b/libgloss/sparc_leon/console_dbg.c index 57c258fb4..f4bfc5c27 100644 --- a/libgloss/sparc_leon/console_dbg.c +++ b/libgloss/sparc_leon/console_dbg.c @@ -25,11 +25,7 @@ #include #include -#ifdef _HAVE_STDC #include -#else -#include -#endif #include #include diff --git a/newlib/doc/ansidecl.h b/newlib/doc/ansidecl.h index 1c7708fd5..f67f93bea 100644 --- a/newlib/doc/ansidecl.h +++ b/newlib/doc/ansidecl.h @@ -74,7 +74,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* LINTLIBRARY */ -#ifdef _HAVE_STDC #define PTR void * #define PTRCONST void *CONST @@ -91,26 +90,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define DEFUN(name, arglist, args) name(args) #define DEFUN_VOID(name) name(NOARGS) -#else /* Not ANSI C. */ - -#define PTR char * -#define PTRCONST PTR -#define LONG_DOUBLE double - -#define AND ; -#define NOARGS -#define CONST -#define VOLATILE -#define SIGNED -#define DOTS - -#define const - -#define EXFUN(name, proto) name() -#define DEFUN(name, arglist, args) name arglist args; -#define DEFUN_VOID(name) name() - -#endif /* ANSI C. */ #endif /* ansidecl.h */ diff --git a/newlib/libc/include/_ansi.h b/newlib/libc/include/_ansi.h index e2737ed48..6c7497efd 100644 --- a/newlib/libc/include/_ansi.h +++ b/newlib/libc/include/_ansi.h @@ -1,11 +1,6 @@ /* Provide support for both ANSI and non-ANSI environments. */ -/* Some ANSI environments are "broken" in the sense that __STDC__ cannot be - relied upon to have it's intended meaning. Therefore we must use our own - concoction: _HAVE_STDC. Always use _HAVE_STDC instead of __STDC__ in newlib - sources! - - To get a strict ANSI C environment, define macro __STRICT_ANSI__. This will +/* To get a strict ANSI C environment, define macro __STRICT_ANSI__. This will "comment out" the non-ANSI parts of the ANSI header files (non-ANSI header files aren't affected). */ @@ -15,14 +10,6 @@ #include #include -/* First try to figure out whether we really are in an ANSI C environment. */ -/* FIXME: This probably needs some work. Perhaps sys/config.h can be - prevailed upon to give us a clue. */ - -#ifdef __STDC__ -#define _HAVE_STDC -#endif - /* ISO C++. */ #ifdef __cplusplus @@ -46,13 +33,9 @@ #define _NOTHROW #endif -#ifdef _HAVE_STDC #ifndef _LONG_DOUBLE #define _LONG_DOUBLE long double #endif -#else -#define _LONG_DOUBLE double -#endif /* Support gcc's __attribute__ facility. */ diff --git a/newlib/libc/include/machine/fastmath.h b/newlib/libc/include/machine/fastmath.h index b13befa22..d13ab3b73 100644 --- a/newlib/libc/include/machine/fastmath.h +++ b/newlib/libc/include/machine/fastmath.h @@ -46,7 +46,6 @@ double EXFUN(fast_loge,(double)); #define log2(x) fast_log2(x) #define loge(x) fast_loge(x) -#ifdef _HAVE_STDC /* These functions are in assembler, they really do take floats. This can only be used with a real ANSI compiler */ @@ -94,7 +93,6 @@ float EXFUN(fast_logef,(float)); #define log10f(x) fast_log10f(x) #define log2f(x) fast_log2f(x) #define logef(x) fast_logef(x) -#endif /* Override the functions defined in math.h */ #endif /* __sysvnecv70_target */ diff --git a/newlib/libc/machine/powerpc/vfprintf.c b/newlib/libc/machine/powerpc/vfprintf.c index 2cae2aaa1..1244f39f1 100644 --- a/newlib/libc/machine/powerpc/vfprintf.c +++ b/newlib/libc/machine/powerpc/vfprintf.c @@ -120,11 +120,7 @@ static char *rcsid = "$Id$"; #include #endif -#ifdef _HAVE_STDC #include -#else -#include -#endif #include "local.h" #include "fvwrite.h" diff --git a/newlib/libc/machine/powerpc/vfscanf.c b/newlib/libc/machine/powerpc/vfscanf.c index f0443bf4a..111fe5f9e 100644 --- a/newlib/libc/machine/powerpc/vfscanf.c +++ b/newlib/libc/machine/powerpc/vfscanf.c @@ -77,11 +77,7 @@ Supporting OS subroutines required: #include #include #include -#ifdef _HAVE_STDC #include -#else -#include -#endif #include "local.h" #ifndef NO_FLOATING_POINT diff --git a/newlib/libc/machine/spu/vfprintf.c b/newlib/libc/machine/spu/vfprintf.c index 6e436421b..deda41571 100644 --- a/newlib/libc/machine/spu/vfprintf.c +++ b/newlib/libc/machine/spu/vfprintf.c @@ -35,11 +35,7 @@ Author: Joel Schopp #include "c99ppe.h" -#ifdef _HAVE_STDC #include -#else -#include -#endif #ifdef INTEGER_ONLY # define vfprintf vfiprintf diff --git a/newlib/libc/machine/spu/vfscanf.c b/newlib/libc/machine/spu/vfscanf.c index 9af12e91a..9e093ba28 100644 --- a/newlib/libc/machine/spu/vfscanf.c +++ b/newlib/libc/machine/spu/vfscanf.c @@ -35,11 +35,7 @@ Author: Joel Schopp #include "c99ppe.h" -#ifdef _HAVE_STDC #include -#else -#include -#endif #ifdef INTEGER_ONLY # define vfscanf vfiscanf diff --git a/newlib/libc/machine/spu/vprintf.c b/newlib/libc/machine/spu/vprintf.c index 29cac0c8d..de98c0a33 100644 --- a/newlib/libc/machine/spu/vprintf.c +++ b/newlib/libc/machine/spu/vprintf.c @@ -3,11 +3,7 @@ #include "c99ppe.h" -#ifdef _HAVE_STDC #include -#else -#include -#endif #ifdef INTEGER_ONLY # define vprintf viprintf diff --git a/newlib/libc/machine/spu/vscanf.c b/newlib/libc/machine/spu/vscanf.c index 39348905d..e2d324ed7 100644 --- a/newlib/libc/machine/spu/vscanf.c +++ b/newlib/libc/machine/spu/vscanf.c @@ -35,11 +35,7 @@ Author: Joel Schopp #include "c99ppe.h" -#ifdef _HAVE_STDC #include -#else -#include -#endif #ifdef INTEGER_ONLY # define vscanf viscanf diff --git a/newlib/libc/machine/spu/vsnprintf.c b/newlib/libc/machine/spu/vsnprintf.c index 81ba7bef2..298165f5a 100644 --- a/newlib/libc/machine/spu/vsnprintf.c +++ b/newlib/libc/machine/spu/vsnprintf.c @@ -3,11 +3,7 @@ #include "c99ppe.h" -#ifdef _HAVE_STDC #include -#else -#include -#endif #ifdef INTEGER_ONLY # define vsnprintf vsniprintf diff --git a/newlib/libc/machine/spu/vsprintf.c b/newlib/libc/machine/spu/vsprintf.c index 8b0e414de..8317a6636 100644 --- a/newlib/libc/machine/spu/vsprintf.c +++ b/newlib/libc/machine/spu/vsprintf.c @@ -4,11 +4,7 @@ #include "c99ppe.h" -#ifdef _HAVE_STDC #include -#else -#include -#endif #ifdef INTEGER_ONLY # define vsprintf vsiprintf diff --git a/newlib/libc/machine/spu/vsscanf.c b/newlib/libc/machine/spu/vsscanf.c index a94b152d2..ed6421422 100644 --- a/newlib/libc/machine/spu/vsscanf.c +++ b/newlib/libc/machine/spu/vsscanf.c @@ -35,11 +35,7 @@ Author: Joel Schopp #include "c99ppe.h" -#ifdef _HAVE_STDC #include -#else -#include -#endif #ifdef INTEGER_ONLY # define vsscanf vsiscanf diff --git a/newlib/libc/posix/execl.c b/newlib/libc/posix/execl.c index 6ba95e2dc..c3b4e55bd 100644 --- a/newlib/libc/posix/execl.c +++ b/newlib/libc/posix/execl.c @@ -13,7 +13,6 @@ 'environ'. */ static char ***p_environ = &environ; -#ifdef _HAVE_STDC #include @@ -21,16 +20,6 @@ int execl (const char *path, const char *arg0, ...) -#else - -#include - -int -execl (const char *path, - const char *arg0, - va_dcl) - -#endif { int i; diff --git a/newlib/libc/posix/execle.c b/newlib/libc/posix/execle.c index 641bdac72..34f0ea373 100644 --- a/newlib/libc/posix/execle.c +++ b/newlib/libc/posix/execle.c @@ -8,7 +8,6 @@ #include <_ansi.h> #include -#ifdef _HAVE_STDC #include @@ -16,16 +15,6 @@ int execle (const char *path, const char *arg0, ...) -#else - -#include - -int -execle (const char *path, - const char *arg0, - va_dcl) - -#endif { int i; diff --git a/newlib/libc/posix/execlp.c b/newlib/libc/posix/execlp.c index 41b300d8f..b845c88c5 100644 --- a/newlib/libc/posix/execlp.c +++ b/newlib/libc/posix/execlp.c @@ -8,7 +8,6 @@ #include <_ansi.h> #include -#ifdef _HAVE_STDC #include @@ -16,16 +15,6 @@ int execlp (const char *path, const char *arg0, ...) -#else - -#include - -int -execlp (const char *path, - const char *arg0, - va_dcl) - -#endif { int i; diff --git a/newlib/libc/stdio/fiscanf.c b/newlib/libc/stdio/fiscanf.c index 7b497bddb..ea93f7542 100644 --- a/newlib/libc/stdio/fiscanf.c +++ b/newlib/libc/stdio/fiscanf.c @@ -18,33 +18,18 @@ #include <_ansi.h> #include #include -#ifdef _HAVE_STDC #include -#else -#include -#endif #include "local.h" #ifndef _REENT_ONLY int -#ifdef _HAVE_STDC fiscanf(FILE *fp, const char *fmt, ...) -#else -fiscanf(FILE *fp, fmt, va_alist) - FILE *fp; - char *fmt; - va_dcl -#endif { int ret; va_list ap; -#ifdef _HAVE_STDC va_start (ap, fmt); -#else - va_start (ap); -#endif ret = __svfiscanf_r (_REENT, fp, fmt, ap); va_end (ap); return ret; @@ -53,24 +38,12 @@ fiscanf(FILE *fp, fmt, va_alist) #endif /* !_REENT_ONLY */ int -#ifdef _HAVE_STDC _fiscanf_r(struct _reent *ptr, FILE *fp, const char *fmt, ...) -#else -_fiscanf_r(ptr, FILE *fp, fmt, va_alist) - struct _reent *ptr; - FILE *fp; - char *fmt; - va_dcl -#endif { int ret; va_list ap; -#ifdef _HAVE_STDC va_start (ap, fmt); -#else - va_start (ap); -#endif ret = __svfiscanf_r (ptr, fp, fmt, ap); va_end (ap); return (ret); diff --git a/newlib/libc/stdio/fscanf.c b/newlib/libc/stdio/fscanf.c index 94096a22b..af01eedbe 100644 --- a/newlib/libc/stdio/fscanf.c +++ b/newlib/libc/stdio/fscanf.c @@ -18,33 +18,18 @@ #include <_ansi.h> #include #include -#ifdef _HAVE_STDC #include -#else -#include -#endif #include "local.h" #ifndef _REENT_ONLY int -#ifdef _HAVE_STDC fscanf(FILE *__restrict fp, const char *__restrict fmt, ...) -#else -fscanf(FILE *fp, fmt, va_alist) - FILE *fp; - char *fmt; - va_dcl -#endif { int ret; va_list ap; -#ifdef _HAVE_STDC va_start (ap, fmt); -#else - va_start (ap); -#endif ret = _vfscanf_r (_REENT, fp, fmt, ap); va_end (ap); return ret; @@ -59,24 +44,12 @@ fiscanf (FILE *, const char *, ...) #endif /* !_REENT_ONLY */ int -#ifdef _HAVE_STDC _fscanf_r(struct _reent *ptr, FILE *__restrict fp, const char *__restrict fmt, ...) -#else -_fscanf_r(ptr, FILE *fp, fmt, va_alist) - struct _reent *ptr; - FILE *fp; - char *fmt; - va_dcl -#endif { int ret; va_list ap; -#ifdef _HAVE_STDC va_start (ap, fmt); -#else - va_start (ap); -#endif ret = _vfscanf_r (ptr, fp, fmt, ap); va_end (ap); return (ret); diff --git a/newlib/libc/stdio/iscanf.c b/newlib/libc/stdio/iscanf.c index aefd1a4ac..980dabd29 100644 --- a/newlib/libc/stdio/iscanf.c +++ b/newlib/libc/stdio/iscanf.c @@ -18,33 +18,19 @@ #include <_ansi.h> #include #include -#ifdef _HAVE_STDC #include -#else -#include -#endif #include "local.h" #ifndef _REENT_ONLY int -#ifdef _HAVE_STDC iscanf(const char *fmt, ...) -#else -iscanf(fmt, va_alist) - char *fmt; - va_dcl -#endif { int ret; va_list ap; _REENT_SMALL_CHECK_INIT (_REENT); -#ifdef _HAVE_STDC va_start (ap, fmt); -#else - va_start (ap); -#endif ret = __svfiscanf_r (_REENT, _stdin_r (_REENT), fmt, ap); va_end (ap); return ret; @@ -53,24 +39,13 @@ iscanf(fmt, va_alist) #endif /* !_REENT_ONLY */ int -#ifdef _HAVE_STDC _iscanf_r(struct _reent *ptr, const char *fmt, ...) -#else -_iscanf_r(ptr, fmt, va_alist) - struct _reent *ptr; - char *fmt; - va_dcl -#endif { int ret; va_list ap; _REENT_SMALL_CHECK_INIT (ptr); -#ifdef _HAVE_STDC va_start (ap, fmt); -#else - va_start (ap); -#endif ret = __svfiscanf_r (ptr, _stdin_r (ptr), fmt, ap); va_end (ap); return (ret); diff --git a/newlib/libc/stdio/scanf.c b/newlib/libc/stdio/scanf.c index a5a9391c0..898c6e7af 100644 --- a/newlib/libc/stdio/scanf.c +++ b/newlib/libc/stdio/scanf.c @@ -18,34 +18,20 @@ #include <_ansi.h> #include #include -#ifdef _HAVE_STDC #include -#else -#include -#endif #include "local.h" #ifndef _REENT_ONLY int -#ifdef _HAVE_STDC scanf(const char *__restrict fmt, ...) -#else -scanf(fmt, va_alist) - char *fmt; - va_dcl -#endif { int ret; va_list ap; struct _reent *reent = _REENT; _REENT_SMALL_CHECK_INIT (reent); -#ifdef _HAVE_STDC va_start (ap, fmt); -#else - va_start (ap); -#endif ret = _vfscanf_r (reent, _stdin_r (reent), fmt, ap); va_end (ap); return ret; @@ -60,24 +46,13 @@ iscanf (const char *, ...) #endif /* !_REENT_ONLY */ int -#ifdef _HAVE_STDC _scanf_r(struct _reent *ptr, const char *__restrict fmt, ...) -#else -_scanf_r(ptr, fmt, va_alist) - struct _reent *ptr; - char *fmt; - va_dcl -#endif { int ret; va_list ap; _REENT_SMALL_CHECK_INIT (ptr); -#ifdef _HAVE_STDC va_start (ap, fmt); -#else - va_start (ap); -#endif ret = _vfscanf_r (ptr, _stdin_r (ptr), fmt, ap); va_end (ap); return (ret); diff --git a/newlib/libc/stdio/siprintf.c b/newlib/libc/stdio/siprintf.c index 6ec24777e..be000f629 100644 --- a/newlib/libc/stdio/siprintf.c +++ b/newlib/libc/stdio/siprintf.c @@ -94,26 +94,14 @@ Supporting OS subroutines required: <>, <>, <>, #include <_ansi.h> #include #include -#ifdef _HAVE_STDC #include -#else -#include -#endif #include #include "local.h" int -#ifdef _HAVE_STDC _siprintf_r (struct _reent *ptr, char *str, const char *fmt, ...) -#else -_siprintf_r(ptr, str, fmt, va_alist) - struct _reent *ptr; - char *str; - const char *fmt; - va_dcl -#endif { int ret; va_list ap; @@ -123,11 +111,7 @@ _siprintf_r(ptr, str, fmt, va_alist) f._bf._base = f._p = (unsigned char *) str; f._bf._size = f._w = INT_MAX; f._file = -1; /* No file. */ -#ifdef _HAVE_STDC va_start (ap, fmt); -#else - va_start (ap); -#endif ret = _svfiprintf_r (ptr, &f, fmt, ap); va_end (ap); *f._p = 0; @@ -137,15 +121,8 @@ _siprintf_r(ptr, str, fmt, va_alist) #ifndef _REENT_ONLY int -#ifdef _HAVE_STDC siprintf (char *str, const char *fmt, ...) -#else -siprintf(str, fmt, va_alist) - char *str; - const char *fmt; - va_dcl -#endif { int ret; va_list ap; @@ -155,11 +132,7 @@ siprintf(str, fmt, va_alist) f._bf._base = f._p = (unsigned char *) str; f._bf._size = f._w = INT_MAX; f._file = -1; /* No file. */ -#ifdef _HAVE_STDC va_start (ap, fmt); -#else - va_start (ap); -#endif ret = _svfiprintf_r (_REENT, &f, fmt, ap); va_end (ap); *f._p = 0; diff --git a/newlib/libc/stdio/siscanf.c b/newlib/libc/stdio/siscanf.c index 9b45ecdbb..355d2662a 100644 --- a/newlib/libc/stdio/siscanf.c +++ b/newlib/libc/stdio/siscanf.c @@ -76,26 +76,14 @@ Supporting OS subroutines required: <>, <>, <>, #include #include #include -#ifdef _HAVE_STDC #include -#else -#include -#endif #include "local.h" #ifndef _REENT_ONLY -#ifdef _HAVE_STDC int siscanf (const char *str, const char *fmt, ...) -#else -int -siscanf(str, fmt, va_alist) - const char *str; - const char *fmt; - va_dcl -#endif { int ret; va_list ap; @@ -108,11 +96,7 @@ siscanf(str, fmt, va_alist) f._ub._base = NULL; f._lb._base = NULL; f._file = -1; /* No file. */ -#ifdef _HAVE_STDC va_start (ap, fmt); -#else - va_start (ap); -#endif ret = __ssvfiscanf_r (_REENT, &f, fmt, ap); va_end (ap); return ret; @@ -120,19 +104,10 @@ siscanf(str, fmt, va_alist) #endif /* !_REENT_ONLY */ -#ifdef _HAVE_STDC int _siscanf_r (struct _reent *ptr, const char *str, const char *fmt, ...) -#else -int -_siscanf_r(ptr, str, fmt, va_alist) - struct _reent *ptr; - const char *str; - const char *fmt; - va_dcl -#endif { int ret; va_list ap; @@ -145,11 +120,7 @@ _siscanf_r(ptr, str, fmt, va_alist) f._ub._base = NULL; f._lb._base = NULL; f._file = -1; /* No file. */ -#ifdef _HAVE_STDC va_start (ap, fmt); -#else - va_start (ap); -#endif ret = __ssvfiscanf_r (ptr, &f, fmt, ap); va_end (ap); return ret; diff --git a/newlib/libc/stdio/sniprintf.c b/newlib/libc/stdio/sniprintf.c index d13278437..840c564dc 100644 --- a/newlib/libc/stdio/sniprintf.c +++ b/newlib/libc/stdio/sniprintf.c @@ -21,29 +21,16 @@ #include <_ansi.h> #include #include -#ifdef _HAVE_STDC #include -#else -#include -#endif #include #include #include "local.h" int -#ifdef _HAVE_STDC _sniprintf_r (struct _reent *ptr, char *str, size_t size, const char *fmt, ...) -#else -_sniprintf_r (ptr, str, size, fmt, va_alist) - struct _reent *ptr; - char *str; - size_t size; - const char *fmt; - va_dcl -#endif { int ret; va_list ap; @@ -58,11 +45,7 @@ _sniprintf_r (ptr, str, size, fmt, va_alist) f._bf._base = f._p = (unsigned char *) str; f._bf._size = f._w = (size > 0 ? size - 1 : 0); f._file = -1; /* No file. */ -#ifdef _HAVE_STDC va_start (ap, fmt); -#else - va_start (ap); -#endif ret = _svfiprintf_r (ptr, &f, fmt, ap); va_end (ap); if (ret < EOF) @@ -75,17 +58,9 @@ _sniprintf_r (ptr, str, size, fmt, va_alist) #ifndef _REENT_ONLY int -#ifdef _HAVE_STDC sniprintf (char *str, size_t size, const char *fmt, ...) -#else -sniprintf (str, size, fmt, va_alist) - char *str; - size_t size; - const char *fmt; - va_dcl -#endif { int ret; va_list ap; @@ -101,11 +76,7 @@ sniprintf (str, size, fmt, va_alist) f._bf._base = f._p = (unsigned char *) str; f._bf._size = f._w = (size > 0 ? size - 1 : 0); f._file = -1; /* No file. */ -#ifdef _HAVE_STDC va_start (ap, fmt); -#else - va_start (ap); -#endif ret = _svfiprintf_r (ptr, &f, fmt, ap); va_end (ap); if (ret < EOF) diff --git a/newlib/libc/stdio/snprintf.c b/newlib/libc/stdio/snprintf.c index d73cdbf3a..809b52b51 100644 --- a/newlib/libc/stdio/snprintf.c +++ b/newlib/libc/stdio/snprintf.c @@ -20,29 +20,16 @@ #include <_ansi.h> #include #include -#ifdef _HAVE_STDC #include -#else -#include -#endif #include #include #include "local.h" int -#ifdef _HAVE_STDC _snprintf_r (struct _reent *ptr, char *__restrict str, size_t size, const char *__restrict fmt, ...) -#else -_snprintf_r(ptr, str, size, fmt, va_alist) - struct _reent *ptr; - char *str; - size_t size; - const char *fmt; - va_dcl -#endif { int ret; va_list ap; @@ -57,11 +44,7 @@ _snprintf_r(ptr, str, size, fmt, va_alist) f._bf._base = f._p = (unsigned char *) str; f._bf._size = f._w = (size > 0 ? size - 1 : 0); f._file = -1; /* No file. */ -#ifdef _HAVE_STDC va_start (ap, fmt); -#else - va_start (ap); -#endif ret = _svfprintf_r (ptr, &f, fmt, ap); va_end (ap); if (ret < EOF) @@ -80,17 +63,9 @@ _sniprintf_r (struct _reent *, char *, size_t, const char *, ...) #ifndef _REENT_ONLY int -#ifdef _HAVE_STDC snprintf (char *__restrict str, size_t size, const char *__restrict fmt, ...) -#else -snprintf(str, size, fmt, va_alist) - char *str; - size_t size; - const char *fmt; - va_dcl -#endif { int ret; va_list ap; @@ -106,11 +81,7 @@ snprintf(str, size, fmt, va_alist) f._bf._base = f._p = (unsigned char *) str; f._bf._size = f._w = (size > 0 ? size - 1 : 0); f._file = -1; /* No file. */ -#ifdef _HAVE_STDC va_start (ap, fmt); -#else - va_start (ap); -#endif ret = _svfprintf_r (ptr, &f, fmt, ap); va_end (ap); if (ret < EOF) diff --git a/newlib/libc/stdio/sprintf.c b/newlib/libc/stdio/sprintf.c index 37d92f93e..096ca216a 100644 --- a/newlib/libc/stdio/sprintf.c +++ b/newlib/libc/stdio/sprintf.c @@ -570,26 +570,14 @@ Supporting OS subroutines required: <>, <>, <>, #include <_ansi.h> #include #include -#ifdef _HAVE_STDC #include -#else -#include -#endif #include #include "local.h" int -#ifdef _HAVE_STDC _sprintf_r (struct _reent *ptr, char *__restrict str, const char *__restrict fmt, ...) -#else -_sprintf_r(ptr, str, fmt, va_alist) - struct _reent *ptr; - char *__restrict str; - const char *__restrict fmt; - va_dcl -#endif { int ret; va_list ap; @@ -599,11 +587,7 @@ _sprintf_r(ptr, str, fmt, va_alist) f._bf._base = f._p = (unsigned char *) str; f._bf._size = f._w = INT_MAX; f._file = -1; /* No file. */ -#ifdef _HAVE_STDC va_start (ap, fmt); -#else - va_start (ap); -#endif ret = _svfprintf_r (ptr, &f, fmt, ap); va_end (ap); *f._p = '\0'; /* terminate the string */ @@ -619,15 +603,8 @@ _siprintf_r (struct _reent *, char *, const char *, ...) #ifndef _REENT_ONLY int -#ifdef _HAVE_STDC sprintf (char *__restrict str, const char *__restrict fmt, ...) -#else -sprintf(str, fmt, va_alist) - char *str; - const char *fmt; - va_dcl -#endif { int ret; va_list ap; @@ -637,11 +614,7 @@ sprintf(str, fmt, va_alist) f._bf._base = f._p = (unsigned char *) str; f._bf._size = f._w = INT_MAX; f._file = -1; /* No file. */ -#ifdef _HAVE_STDC va_start (ap, fmt); -#else - va_start (ap); -#endif ret = _svfprintf_r (_REENT, &f, fmt, ap); va_end (ap); *f._p = '\0'; /* terminate the string */ diff --git a/newlib/libc/stdio/sscanf.c b/newlib/libc/stdio/sscanf.c index 971db439d..99054e245 100644 --- a/newlib/libc/stdio/sscanf.c +++ b/newlib/libc/stdio/sscanf.c @@ -415,26 +415,14 @@ Supporting OS subroutines required: <>, <>, <>, #include #include #include -#ifdef _HAVE_STDC #include -#else -#include -#endif #include "local.h" #ifndef _REENT_ONLY -#ifdef _HAVE_STDC int sscanf (const char *__restrict str, const char * fmt, ...) -#else -int -sscanf(str, fmt, va_alist) - const char *str; - const char *fmt; - va_dcl -#endif { int ret; va_list ap; @@ -447,11 +435,7 @@ sscanf(str, fmt, va_alist) f._ub._base = NULL; f._lb._base = NULL; f._file = -1; /* No file. */ -#ifdef _HAVE_STDC va_start (ap, fmt); -#else - va_start (ap); -#endif ret = __ssvfscanf_r (_REENT, &f, fmt, ap); va_end (ap); return ret; @@ -465,19 +449,10 @@ siscanf (const char *, const char *, ...) #endif /* !_REENT_ONLY */ -#ifdef _HAVE_STDC int _sscanf_r (struct _reent *ptr, const char *__restrict str, const char *__restrict fmt, ...) -#else -int -_sscanf_r(ptr, str, fmt, va_alist) - struct _reent *ptr; - const char *__restrict str; - const char *__restrict fmt; - va_dcl -#endif { int ret; va_list ap; @@ -490,11 +465,7 @@ _sscanf_r(ptr, str, fmt, va_alist) f._ub._base = NULL; f._lb._base = NULL; f._file = -1; /* No file. */ -#ifdef _HAVE_STDC va_start (ap, fmt); -#else - va_start (ap); -#endif ret = __ssvfscanf_r (ptr, &f, fmt, ap); va_end (ap); return ret; diff --git a/newlib/libc/stdio/viprintf.c b/newlib/libc/stdio/viprintf.c index 9678815f1..a59bc9c19 100644 --- a/newlib/libc/stdio/viprintf.c +++ b/newlib/libc/stdio/viprintf.c @@ -95,11 +95,7 @@ Supporting OS subroutines required: <>, <>, <>, #include <_ansi.h> #include #include -#ifdef _HAVE_STDC #include -#else -#include -#endif #include "local.h" #ifndef _REENT_ONLY diff --git a/newlib/libc/stdio/viscanf.c b/newlib/libc/stdio/viscanf.c index e5ad1dbbd..c19d1b16a 100644 --- a/newlib/libc/stdio/viscanf.c +++ b/newlib/libc/stdio/viscanf.c @@ -79,11 +79,7 @@ Supporting OS subroutines required: #include <_ansi.h> #include #include -#ifdef _HAVE_STDC #include -#else -#include -#endif #include "local.h" #ifndef _REENT_ONLY diff --git a/newlib/libc/stdio/vprintf.c b/newlib/libc/stdio/vprintf.c index fb46c1c1a..b195a1ecf 100644 --- a/newlib/libc/stdio/vprintf.c +++ b/newlib/libc/stdio/vprintf.c @@ -19,11 +19,7 @@ #include <_ansi.h> #include #include -#ifdef _HAVE_STDC #include -#else -#include -#endif #include "local.h" #ifndef _REENT_ONLY diff --git a/newlib/libc/stdio/vscanf.c b/newlib/libc/stdio/vscanf.c index bbbbd0a83..567f5cb3e 100644 --- a/newlib/libc/stdio/vscanf.c +++ b/newlib/libc/stdio/vscanf.c @@ -20,11 +20,7 @@ #include <_ansi.h> #include #include -#ifdef _HAVE_STDC #include -#else -#include -#endif #include "local.h" #ifndef _REENT_ONLY diff --git a/newlib/libc/stdio/vsiscanf.c b/newlib/libc/stdio/vsiscanf.c index 5679df056..b21dcb1a2 100644 --- a/newlib/libc/stdio/vsiscanf.c +++ b/newlib/libc/stdio/vsiscanf.c @@ -21,11 +21,7 @@ #include #include #include -#ifdef _HAVE_STDC #include -#else -#include -#endif #include "local.h" /* diff --git a/newlib/libc/stdio/vsscanf.c b/newlib/libc/stdio/vsscanf.c index 97c7bae80..f4e096b50 100644 --- a/newlib/libc/stdio/vsscanf.c +++ b/newlib/libc/stdio/vsscanf.c @@ -21,11 +21,7 @@ #include #include #include -#ifdef _HAVE_STDC #include -#else -#include -#endif #include "local.h" /* diff --git a/newlib/libc/stdio/vswscanf.c b/newlib/libc/stdio/vswscanf.c index 90393f528..7687001ab 100644 --- a/newlib/libc/stdio/vswscanf.c +++ b/newlib/libc/stdio/vswscanf.c @@ -23,11 +23,7 @@ #include #include #include -#ifdef _HAVE_STDC #include -#else -#include -#endif #include "local.h" /* diff --git a/newlib/libc/stdio/vwscanf.c b/newlib/libc/stdio/vwscanf.c index 3945e79c8..1f33db6af 100644 --- a/newlib/libc/stdio/vwscanf.c +++ b/newlib/libc/stdio/vwscanf.c @@ -22,11 +22,7 @@ #include #include #include -#ifdef _HAVE_STDC #include -#else -#include -#endif #include "local.h" #ifndef _REENT_ONLY diff --git a/newlib/libc/stdlib/std.h b/newlib/libc/stdlib/std.h index b20820be4..c000a67c6 100644 --- a/newlib/libc/stdlib/std.h +++ b/newlib/libc/stdlib/std.h @@ -22,12 +22,6 @@ #define ESIGN 0x02 #define DECP 0x04 -#ifdef _HAVE_STDC int __ten_mul(double *acc, int digit); double __adjust(struct _reent *ptr, double *acc, int dexp, int sign); double __exp10(unsigned x); -#else -int __ten_mul(); -double __adjust(); -double __exp10(); -#endif diff --git a/newlib/libc/syscalls/sysopen.c b/newlib/libc/syscalls/sysopen.c index 4d1a29953..bc8d9d59f 100644 --- a/newlib/libc/syscalls/sysopen.c +++ b/newlib/libc/syscalls/sysopen.c @@ -3,7 +3,6 @@ #include #include -#ifdef _HAVE_STDC /* The prototype in uses ..., so we must correspond. */ @@ -22,15 +21,3 @@ open (const char *file, return ret; } -#else /* ! _HAVE_STDC */ - -int -open (file, flags, mode) - const char *file; - int flags; - int mode; -{ - return _open_r (_REENT, file, flags, mode); -} - -#endif /* ! _HAVE_STDC */ diff --git a/newlib/libm/math/wf_acos.c b/newlib/libm/math/wf_acos.c index ff9f80b26..8154c795e 100644 --- a/newlib/libm/math/wf_acos.c +++ b/newlib/libm/math/wf_acos.c @@ -20,12 +20,7 @@ #include "fdlibm.h" #include -#ifdef _HAVE_STDC float acosf(float x) /* wrapper acosf */ -#else - float acosf(x) /* wrapper acosf */ - float x; -#endif { #ifdef _IEEE_LIBM return __ieee754_acosf(x);