From patchwork Mon Nov 29 15:33:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yann Sionneau X-Patchwork-Id: 1561269 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=kalray.eu header.i=@kalray.eu header.a=rsa-sha256 header.s=sec-sig-email header.b=d+9/RnZ1; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=kalray.eu header.i=@kalray.eu header.a=rsa-sha256 header.s=32AE1B44-9502-11E5-BA35-3734643DEF29 header.b=Fyjc8BI0; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=uclibc-ng.org (client-ip=89.238.66.15; helo=helium.openadk.org; envelope-from=devel-bounces@uclibc-ng.org; receiver=) Received: from helium.openadk.org (helium.openadk.org [89.238.66.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4J2qLk13hzz9sVc for ; Tue, 30 Nov 2021 02:40:46 +1100 (AEDT) Received: from helium.openadk.org (localhost [IPv6:::1]) by helium.openadk.org (Postfix) with ESMTP id 5CDD131EFC31; Mon, 29 Nov 2021 16:40:33 +0100 (CET) Received: from fx304.security-mail.net (mxout.security-mail.net [85.31.212.48]) by helium.openadk.org (Postfix) with ESMTPS id 671E031E0874 for ; Mon, 29 Nov 2021 16:40:05 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by fx304.security-mail.net (Postfix) with ESMTP id 9BEF962885 for ; Mon, 29 Nov 2021 16:33:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kalray.eu; s=sec-sig-email; t=1638200037; bh=O57O91WwUg65x58EmlAd8eAi0zbq1jpBwxFhVFNc32Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=d+9/RnZ1PDf9qpNShWqzqOEoRqwCtCd7CdYAc8kemgiYL82BWRxJd4b4BqDqBf4A/ WInvR8wfSkTxwqHiw1iSu1apKmxVvZGZjE96cyVpj0B+9EPtju7vcv8WGSVCx1v/lf W+leT1lO6iGzsxW46hzdsuCdAGioEtTo4WFkvrlU= Received: from fx304 (localhost [127.0.0.1]) by fx304.security-mail.net (Postfix) with ESMTP id 538D362899 for ; Mon, 29 Nov 2021 16:33:57 +0100 (CET) X-Virus-Scanned: E-securemail Secumail-id: <59a4.61a4f2e4.c50d5.0> Received: from zimbra2.kalray.eu (unknown [217.181.231.53]) by fx304.security-mail.net (Postfix) with ESMTPS id 09DC46288E for ; Mon, 29 Nov 2021 16:33:56 +0100 (CET) Received: from zimbra2.kalray.eu (localhost [127.0.0.1]) by zimbra2.kalray.eu (Postfix) with ESMTPS id 9A2AF27E0398; Mon, 29 Nov 2021 16:33:56 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by zimbra2.kalray.eu (Postfix) with ESMTP id 84EE427E0396; Mon, 29 Nov 2021 16:33:56 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.10.3 zimbra2.kalray.eu 84EE427E0396 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kalray.eu; s=32AE1B44-9502-11E5-BA35-3734643DEF29; t=1638200036; bh=v5qhkzMsbz6tn8xOtOr9TVzZZyblWdE2wpiKR7nPBvg=; h=From:To:Date:Message-Id; b=Fyjc8BI02s/PSdXjThICslh/v7jDZgHSZX/c+vY2uOjj5P4g0kvTBvO3wHSaxToRr Tx4O5f+Pxld5LNejOfFzhPcbevgOSVGL/ZAfzyQmX+3PdZn9A9sA/QBeIiWy6fjqHR Jwx44X7g0yBe6CocQ79fU/N3FJeJYY52XEWc7Dhk= Received: from zimbra2.kalray.eu ([127.0.0.1]) by localhost (zimbra2.kalray.eu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 777WGg-gvoLz; Mon, 29 Nov 2021 16:33:56 +0100 (CET) Received: from junon.lin.mbt.kalray.eu (unknown [192.168.37.161]) by zimbra2.kalray.eu (Postfix) with ESMTPSA id 6C45D27E0387; Mon, 29 Nov 2021 16:33:56 +0100 (CET) From: Yann Sionneau To: devel@uclibc-ng.org Date: Mon, 29 Nov 2021 16:33:35 +0100 Message-Id: <20211129153335.32124-3-ysionneau@kalray.eu> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211129153335.32124-1-ysionneau@kalray.eu> References: <20211129153335.32124-1-ysionneau@kalray.eu> X-Virus-Scanned: by Secumail Message-ID-Hash: ECGS7CR2AP3TGPVNKTLOZEZRMQONLOPL X-Message-ID-Hash: ECGS7CR2AP3TGPVNKTLOZEZRMQONLOPL X-MailFrom: ysionneau@kalray.eu X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list Subject: [uclibc-ng-devel] [PATCH 3/3] Fix some warnings due to type issues List-Id: uClibc-ng Development List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Fixes those two warnings: In file included from : libc/sysdeps/linux/common/openat64.c:18:33: warning: 'openat64' alias between functions of incompatible types 'int(int, const char *, int, ...)' and 'int(int, const char *, int, mode_t)' {aka 'int(int, const char *, int, unsigned int)'} [-Wattribute-alias=] 18 | strong_alias_untyped(__openat64,openat64) | ^~~~~~~~ ./include/libc-symbols.h:177:31: note: in definition of macro '_strong_alias_untyped' 177 | extern __typeof (aliasname) aliasname __attribute__ ((alias (#name))) __attribute_copy__ (name); | ^~~~~~~~~ libc/sysdeps/linux/common/openat64.c:18:1: note: in expansion of macro 'strong_alias_untyped' 18 | strong_alias_untyped(__openat64,openat64) | ^~~~~~~~~~~~~~~~~~~~ libc/sysdeps/linux/common/openat64.c:14:12: note: aliased declaration here 14 | static int __openat64(int fd, const char *file, int oflag, mode_t mode) | ^~~~~~~~~~ and CC libc/sysdeps/linux/common/stat.os libc/sysdeps/linux/common/stat.c: In function 'stat': libc/sysdeps/linux/common/stat.c:28:40: warning: passing argument 3 of 'fstatat64' from incompatible pointer type [-Wincompatible-pointer-types] 28 | return fstatat64(AT_FDCWD, file_name, buf, 0); | ^~~ | | | struct stat * In file included from libc/sysdeps/linux/common/stat.c:11: ./include/sys/stat.h:258:35: note: expected 'struct stat64 * restrict' but argument is of type 'struct stat *' 258 | struct stat64 *__restrict __buf, int __flag) | ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~ Signed-off-by: Yann Sionneau --- libc/sysdeps/linux/common/openat64.c | 10 +++++++++- libc/sysdeps/linux/common/stat.c | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/libc/sysdeps/linux/common/openat64.c b/libc/sysdeps/linux/common/openat64.c index eda3e7db1..cd1b23fa5 100644 --- a/libc/sysdeps/linux/common/openat64.c +++ b/libc/sysdeps/linux/common/openat64.c @@ -9,10 +9,18 @@ #include <_lfs_64.h> #include #include +#include #ifdef __NR_openat -static int __openat64(int fd, const char *file, int oflag, mode_t mode) +static int __openat64(int fd, const char *file, int oflag, ...) { + va_list ap; + mode_t mode; + + va_start(ap, oflag); + mode = va_arg(ap, int); + va_end(ap); + return openat(fd, file, oflag | O_LARGEFILE, mode); } strong_alias_untyped(__openat64,openat64) diff --git a/libc/sysdeps/linux/common/stat.c b/libc/sysdeps/linux/common/stat.c index a860c0c7f..99ce8d2dd 100644 --- a/libc/sysdeps/linux/common/stat.c +++ b/libc/sysdeps/linux/common/stat.c @@ -25,7 +25,7 @@ int stat(const char *file_name, struct stat *buf) int stat(const char *file_name, struct stat *buf) { - return fstatat64(AT_FDCWD, file_name, buf, 0); + return fstatat64(AT_FDCWD, file_name, (struct stat64 *)buf, 0); } #elif __NR_statx && defined __UCLIBC_HAVE_STATX__ # include