From patchwork Sun May 5 19:16:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Marc X-Patchwork-Id: 89505 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 541723858D28 for ; Sun, 5 May 2024 19:16:22 +0000 (GMT) X-Original-To: newlib@sourceware.org Delivered-To: newlib@sourceware.org Received: from maniak.kataplop.net (maniak.kataplop.net [195.15.222.96]) by sourceware.org (Postfix) with ESMTPS id 37DA53858D28 for ; Sun, 5 May 2024 19:16:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 37DA53858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=kataplop.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kataplop.net ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 37DA53858D28 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=195.15.222.96 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714936568; cv=none; b=ieaCfMW+fOfnujfeVw6l92IAfUqCjHXf2nhNiy3IXmMnYZb3ahNbG5ZDY15X3Q6CQkyj+yvBOnOy8snXoC77vUSEOlEypv1ukQ/ARf1jiDVKcN6A+rrYYSg68GF1daj5c3XE9xdfiz9ZiZSgrEvXO6dgWxzSG2+uTBKnegLUonc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714936568; c=relaxed/simple; bh=ZQqXIijaHqf/qoxFD2wgbXSQhdmF0TAtylcslUuulsA=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=RSE1oDRRkQ7zCyI2pnuM8BWJNwJgcZLDJEdG6tYYvk1M0i/oqJJDGxcvn2O/sN1Db9lPqkTM+qZSduxcft/U15BRL4J0w6TOBH9w07M/uS6F86WTXVQ9X1WuJVVs19PoQiIJB67kHnLKJ00VujcEr7wnm1JdEbODt7JLKhKvibY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kataplop.net; s=20231104; t=1714936562; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IzqBrLK7kmsSfzzhN/awnsLKQPi/ksPCO2vtmvPQmqE=; b=RyBoUbxWY75AjeLnPvHKoKB/ZqwyB4HSzL7dQ9KQSRFJYNhDmrePTx71YZVaLLcq1N2jjw g0qTej7xbvVoJVVxWElMcoHCFCs3wNcoiUmvusJy3unE0HvyWk35kMyRpnCOOtKWD98r/e 1Ykgcx3BVpj6bM+iiSvbjGEF6OGZJ+o= Received: from arrakis (static-176-191-105-132.ftth.abo.bbox.fr [176.191.105.132]) by katamaniak (OpenSMTPD) with ESMTPSA id cf8f9e13 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Sun, 5 May 2024 19:16:02 +0000 (UTC) From: Marc To: newlib@sourceware.org Subject: [PATCH] libgloss: fix read and write prototype User-Agent: mu4e 1.12.0; emacs 29.3 Date: Sun, 05 May 2024 21:16:01 +0200 Message-ID: <87msp4ul1q.fsf@arrakis.kataplop.net> MIME-Version: 1.0 X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: newlib-bounces+patchwork=sourceware.org@sourceware.org Use _READ_WRITE_RETURN_TYPE for read/write in libgloss/{read,write}.c to avoid mismatching types. Signed-off-by: Marc Poulhiès --- Hello, building with gcc14-rc for m68k fails with (see my mail earlier this week): src/newlib/libgloss/m68k/../read.c:24:1: error: conflicting types for 'read'; have 'int(int, void *, size_t)' {aka 'int(int, void *, long unsigned int)'} This simple fix makes use of _READ_WRITE_RETURN_TYPE macro to avoid mismatching types. Marc libgloss/read.c | 2 +- libgloss/write.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- 2.42.0 diff --git a/libgloss/read.c b/libgloss/read.c index 83a3b549b..867648278 100644 --- a/libgloss/read.c +++ b/libgloss/read.c @@ -20,7 +20,7 @@ extern char inbyte (void); * read -- read bytes from the serial port. Ignore fd, since * we only have stdin. */ -int +_READ_WRITE_RETURN_TYPE read (int fd, void *buf_, size_t nbytes) diff --git a/libgloss/write.c b/libgloss/write.c index 80bcd4a77..757141291 100644 --- a/libgloss/write.c +++ b/libgloss/write.c @@ -21,7 +21,7 @@ extern int outbyte (char x); * stdout and stderr are the same. Since we have no filesystem, * open will only return an error. */ -int +_READ_WRITE_RETURN_TYPE write (int fd, const void *buf_, size_t nbytes)