From patchwork Mon Oct 1 21:37:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 147939 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp4399303lji; Mon, 1 Oct 2018 14:38:01 -0700 (PDT) X-Google-Smtp-Source: ACcGV61kCm/GsTs5220yRtvwR+ERJmtGIUSTNyWOeWIS55PXdkJfHXddq7DIUmDjeYrRrUNwggi2 X-Received: by 2002:a62:23cd:: with SMTP id q74-v6mr13325842pfj.151.1538429880881; Mon, 01 Oct 2018 14:38:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538429880; cv=none; d=google.com; s=arc-20160816; b=JH65I9uY+VgyuqC682I9w3aoZwOkxz/GrW5ARDRGqa77ge1BNTzKEqTFlUN20Fwa5g ge9JlcC9I89y0cHRqsK0q1NPZjwWspU721/33Crh3A4QVQOIJIJ38DzXr84n7prn2YJU 8tGD3ANFdsZUXP5sSTiqa/DAjU6AqgX5FxLuL0uQRd3bXvTkmGKcsRhpkFldHYdS9Oy3 BtHw66njHyP5Itxqyu4Wt63LqkC0kTUfD+KigMEjdMw4JtrPqoAxJX0Bx2ok79HlBNm8 mT+sy7SYqE666hZl0OuICbLotzaatsMzrFbJ3eia3EZEYioqn2+EVtYQZ4J0DxNSXvDw vbxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:subject:message-id:date:from:mime-version:dkim-signature :delivered-to:sender:list-help:list-post:list-archive:list-subscribe :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=D4hSvkwiMfTBjMAyPcpMYumXkZGMkRVAFF8ljDEiFWs=; b=lMU/9m4feUGv2H4sOsNOFnCpfa5wYZS5e1VDuJ1kWuFzDpTyxY5egqgucKJOWVcNZh uKP7r1aVrk4n2waLwJGntRe1awPsNSEzEQ0+dQHP8ORKTica2nuRxLwJ/qlBUU0rbSrq aze2SKmwN2QqFvRH7UDj4HBhqRBcbPh29uBwnijSJH16YR2IQpVKCfmrWfH71c3smiUy zcJUDaVZXrgJopCoEH8kcoF+KZJPF6d2deIZMX8AA8xof87Rv712oatDwVRUpPle4ziz jgHW2/HGPsDzDU0avVR4hbhMMV8PeYftioMGxFsdd0Vhbs1aHlq4e6SE1Po93HhR9Nxv OuRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=VdDGPv0e; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=kOLvcQ6d; spf=pass (google.com: domain of newlib-return-16508-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="newlib-return-16508-patch=linaro.org@sourceware.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id x12-v6si13303175plv.500.2018.10.01.14.38.00 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Oct 2018 14:38:00 -0700 (PDT) Received-SPF: pass (google.com: domain of newlib-return-16508-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=VdDGPv0e; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=kOLvcQ6d; spf=pass (google.com: domain of newlib-return-16508-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="newlib-return-16508-patch=linaro.org@sourceware.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:from:date:message-id:subject:to :content-type; q=dns; s=default; b=Pbb3WUg3Fm6mA2ej1lAgqLyL6w2Tn MvtrmNcgctoW1GgpcTNBl291la2xxnI4zH4ZJjiY9vOTz/v9hw2MAPdLfWWbao3H 2pBMYGfQ/SBapO0RDYjVIlSNAtz0BBF+LFxbWDzzNfyl5CuPAL8wjiKZCJjcS1RT P1o2rQEO+NMUOE= 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:mime-version:from:date:message-id:subject:to :content-type; s=default; bh=wwuyRXXJ4y7IjWmNTU6KemOXx1I=; b=VdD GPv0ead8eLs7zu9xHD22BDh+i+KuNa2XFonSgKMaD388aLahAgSYE+p3Np9ZBPxs KekNx05e0q7uMHSZ/B2MfGCxNgZFIkJOKBO1+Bpg/tAh73+2oU78E2Mrij2Usnqv cAHOSH4pSzC1V7YhoFS/GTFzYOu3/+qR/DLyXIsI= Received: (qmail 44300 invoked by alias); 1 Oct 2018 21:37:52 -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 44252 invoked by uid 89); 1 Oct 2018 21:37:50 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=H*r:sk:i4-v6so X-HELO: mail-ua1-f48.google.com Received: from mail-ua1-f48.google.com (HELO mail-ua1-f48.google.com) (209.85.222.48) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 01 Oct 2018 21:37:48 +0000 Received: by mail-ua1-f48.google.com with SMTP id i4-v6so5523802uak.0 for ; Mon, 01 Oct 2018 14:37:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:from:date:message-id:subject:to; bh=ulZqrkW9HrS/ibDCiar0+ZtXWjCEa6mvGgeC+zjqSa0=; b=kOLvcQ6dvp7ezrEJDaGW5OXdE41/M/QsulD1IljSBGi30dnIZo8SlLLtZIoUPT+eS0 j4IcrKyY3/OlqUVxcSMZpjtCRA31oQkRZLa3XrpEsf0n4lR+gzk/Mf1o/Gnt0Ku4k9g2 D3VBm0Gaz5bzF4TIOo/w7xpW8o7AASgoQJfb0= MIME-Version: 1.0 From: Christophe Lyon Date: Mon, 1 Oct 2018 23:37:35 +0200 Message-ID: Subject: Add forward declarations To: newlib@sourceware.org X-IsSubscribed: yes Hi, While building newlib for Aarch64, I noticed several warnings because of missing prototypes. I am not familiar enough to know why the same warnings do not appear when building for Arm. This patch adds the missing prototypes, tested by rebuilding for Aarch64 and Arm, it removed the warnings and didn't generate any error. OK? Christophe commit 91b75af446b712f7f1a84d0afdf5d3f03a2377ed Author: Christophe Lyon Date: Mon Oct 1 21:16:40 2018 +0000 Add forward declarations. 2018-10-01 Christophe Lyon * newlib/libc/reent/closer.c: Add _close prototype. * newlib/libc/reent/execr.c: Add _execve and fork prototypes. * newlib/libc/reent/fcntlr.c: Add _fcntl prototype. * newlib/libc/reent/fstatr.c: Add _fstat prototype. * newlib/libc/reent/gettimeofdayr.c: Add _gettimeofday prototype. * newlib/libc/reent/isattyr.c: Add _isatty prototype. * newlib/libc/reent/linkr.c: Add _link prototype. * newlib/libc/reent/lseekr.c: Add _lseek prototype. * newlib/libc/reent/mkdirr.c: Add _mkdir prototype. * newlib/libc/reent/openr.c: Add _open prototype. * newlib/libc/reent/readr.c: Add _read prototype. * newlib/libc/reent/signalr.c: Add _kill and _getpid prototypes. * newlib/libc/reent/statr.c: Add _stat prototype. * newlib/libc/reent/timesr.c: Add _times prototype. * newlib/libc/reent/unlinkr.c: Add _unlink prototype. * newlib/libc/reent/writer.c: Add _write prototype. * newlib/libc/stdlib/strtorx: Add nanl prototype. * newlib/libc/syscalls/sysisatty.c: Add _isatty prototype. diff --git a/newlib/libc/reent/closer.c b/newlib/libc/reent/closer.c index deb34b0..1bef515 100644 --- a/newlib/libc/reent/closer.c +++ b/newlib/libc/reent/closer.c @@ -19,6 +19,9 @@ #undef errno extern int errno; +/* Forward declaration. */ +int _close (int); + /* FUNCTION <<_close_r>>---Reentrant version of close diff --git a/newlib/libc/reent/execr.c b/newlib/libc/reent/execr.c index 59b6122..90201b7 100644 --- a/newlib/libc/reent/execr.c +++ b/newlib/libc/reent/execr.c @@ -27,6 +27,10 @@ int _dummy_exec_syscalls = 1; #undef errno extern int errno; +/* Forward declarations. */ +int _execve(const char *filename, char *const argv[], char *const envp[]); +int _fork(); + /* FUNCTION <<_execve_r>>---Reentrant version of execve diff --git a/newlib/libc/reent/fcntlr.c b/newlib/libc/reent/fcntlr.c index cd19d22..27ab74c 100644 --- a/newlib/libc/reent/fcntlr.c +++ b/newlib/libc/reent/fcntlr.c @@ -21,6 +21,9 @@ #undef errno extern int errno; +/* Forward declaration. */ +int _fcntl (int, int, ...); + /* FUNCTION <<_fcntl_r>>---Reentrant version of fcntl diff --git a/newlib/libc/reent/fstatr.c b/newlib/libc/reent/fstatr.c index ec906c9..dcbaaee 100644 --- a/newlib/libc/reent/fstatr.c +++ b/newlib/libc/reent/fstatr.c @@ -25,6 +25,9 @@ int _dummy_fstat_syscalls = 1; #undef errno extern int errno; +/* Forward declaration. */ +int _fstat(int, struct stat *); + /* FUNCTION <<_fstat_r>>---Reentrant version of fstat diff --git a/newlib/libc/reent/gettimeofdayr.c b/newlib/libc/reent/gettimeofdayr.c index 9b982a9..361ee4f 100644 --- a/newlib/libc/reent/gettimeofdayr.c +++ b/newlib/libc/reent/gettimeofdayr.c @@ -28,6 +28,9 @@ int _dummy_gettimeofday_syscalls = 1; #undef errno extern int errno; +/* Forward declaration. */ +int _gettimeofday (struct timeval *, void *); + /* FUNCTION <<_gettimeofday_r>>---Reentrant version of gettimeofday diff --git a/newlib/libc/reent/isattyr.c b/newlib/libc/reent/isattyr.c index f21bf25..dcd609d 100644 --- a/newlib/libc/reent/isattyr.c +++ b/newlib/libc/reent/isattyr.c @@ -23,6 +23,9 @@ int _dummy_isatty_syscalls = 1; #undef errno extern int errno; +/* Forward declaration. */ +int _isatty (int); + /* FUNCTION <<_isatty_r>>---Reentrant version of isatty diff --git a/newlib/libc/reent/linkr.c b/newlib/libc/reent/linkr.c index b22da5f..701b8f3 100644 --- a/newlib/libc/reent/linkr.c +++ b/newlib/libc/reent/linkr.c @@ -24,6 +24,9 @@ int _dummy_link_syscalls = 1; #undef errno extern int errno; +/* Forward declaration. */ +int _link (const char *, const char *); + /* FUNCTION <<_link_r>>---Reentrant version of link diff --git a/newlib/libc/reent/lseekr.c b/newlib/libc/reent/lseekr.c index ac2daaa..d39f942 100644 --- a/newlib/libc/reent/lseekr.c +++ b/newlib/libc/reent/lseekr.c @@ -19,6 +19,9 @@ #undef errno extern int errno; +/* Forward declaration. */ +_off_t _lseek (int, _off_t, int); + /* FUNCTION <<_lseek_r>>---Reentrant version of lseek diff --git a/newlib/libc/reent/mkdirr.c b/newlib/libc/reent/mkdirr.c index fd72df6..f0bf749 100644 --- a/newlib/libc/reent/mkdirr.c +++ b/newlib/libc/reent/mkdirr.c @@ -19,6 +19,9 @@ #undef errno extern int errno; +/* Forward declaration. */ +int _mkdir (const char *, mode_t); + /* FUNCTION <<_mkdir_r>>---Reentrant version of mkdir diff --git a/newlib/libc/reent/openr.c b/newlib/libc/reent/openr.c index c6a7db5..a63de62 100644 --- a/newlib/libc/reent/openr.c +++ b/newlib/libc/reent/openr.c @@ -20,6 +20,9 @@ #undef errno extern int errno; +/* Forward declaration. */ +int _open (const char *, int, ...); + /* FUNCTION <<_open_r>>---Reentrant version of open diff --git a/newlib/libc/reent/readr.c b/newlib/libc/reent/readr.c index 7fccefd..09462ef 100644 --- a/newlib/libc/reent/readr.c +++ b/newlib/libc/reent/readr.c @@ -19,6 +19,9 @@ #undef errno extern int errno; +/* Forward declaration. */ +int _read (int, void *, size_t); + /* FUNCTION <<_read_r>>---Reentrant version of read diff --git a/newlib/libc/reent/signalr.c b/newlib/libc/reent/signalr.c index 345910e..217c368 100644 --- a/newlib/libc/reent/signalr.c +++ b/newlib/libc/reent/signalr.c @@ -25,6 +25,10 @@ int _dummy_link_syscalls = 1; #undef errno extern int errno; +/* Forward declarations. */ +int _kill (int, int); +int _getpid (); + /* FUNCTION <<_kill_r>>---Reentrant version of kill diff --git a/newlib/libc/reent/statr.c b/newlib/libc/reent/statr.c index 9388e02..f338940 100644 --- a/newlib/libc/reent/statr.c +++ b/newlib/libc/reent/statr.c @@ -26,6 +26,9 @@ int _dummy_stat_syscalls = 1; #undef errno extern int errno; +/* Forward declaration. */ +int _stat (const char *, struct stat *); + /* FUNCTION <<_stat_r>>---Reentrant version of stat diff --git a/newlib/libc/reent/timesr.c b/newlib/libc/reent/timesr.c index bb89003..ab80176 100644 --- a/newlib/libc/reent/timesr.c +++ b/newlib/libc/reent/timesr.c @@ -25,6 +25,9 @@ int _dummy_times_syscalls = 1; #undef errno extern int errno; +/* Forward declaration. */ +clock_t _times (struct tms *); + /* FUNCTION <<_times_r>>---Reentrant version of times diff --git a/newlib/libc/reent/unlinkr.c b/newlib/libc/reent/unlinkr.c index 41bac01..d6fd460 100644 --- a/newlib/libc/reent/unlinkr.c +++ b/newlib/libc/reent/unlinkr.c @@ -20,6 +20,9 @@ #undef errno extern int errno; +/* Forward declaration. */ +int _unlink (const char *); + /* FUNCTION <<_unlink_r>>---Reentrant version of unlink diff --git a/newlib/libc/reent/writer.c b/newlib/libc/reent/writer.c index 704aba1..ffb468d 100644 --- a/newlib/libc/reent/writer.c +++ b/newlib/libc/reent/writer.c @@ -19,6 +19,9 @@ #undef errno extern int errno; +/* Forward declaration. */ +int _write (int, const void *, size_t); + /* FUNCTION <<_write_r>>---Reentrant version of write diff --git a/newlib/libc/stdlib/strtorx.c b/newlib/libc/stdlib/strtorx.c index a35dabe..fcea9f2 100644 --- a/newlib/libc/stdlib/strtorx.c +++ b/newlib/libc/stdlib/strtorx.c @@ -55,6 +55,9 @@ THIS SOFTWARE. #define _4 0 #endif +/* Forward declaration. */ +long double nanl(const char *tagp); + void #ifdef KR_headers ULtox(L, bits, exp, k) __UShort *L; __ULong *bits; Long exp; int k; diff --git a/newlib/libc/syscalls/sysisatty.c b/newlib/libc/syscalls/sysisatty.c index 697c54b..2672ae1 100644 --- a/newlib/libc/syscalls/sysisatty.c +++ b/newlib/libc/syscalls/sysisatty.c @@ -3,6 +3,9 @@ #include #include +/* Forward declaration. */ +int _isatty (int); + int isatty (int fd) {