From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) by sourceware.org (Postfix) with ESMTPS id F23A83858D38 for ; Mon, 12 Feb 2024 15:36:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F23A83858D38 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=foss.st.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=foss.st.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org F23A83858D38 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=91.207.212.93 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707752213; cv=none; b=IEU/IoaFBPiF9jO58c0eNilZNsxXKbFWzRD5EFXS6W/7PXPIjHYNQGLjcsxtJj6OiaEzs8SS0WY3A7WgI6k3XwxMZWBIUaZzdxd+YahxUEjTY8GpscY/CvmASJ7FUZ0tB9Ca3CKGxJkSWYifRVnmgkBKc06qNjfWz5mzliy6JPs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707752213; c=relaxed/simple; bh=+96TBhfvo6fGknAsfMWutiN453cG7WiBIT8LYvfiMCU=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=rKvUtJQlE84uNoIC+Mvjmerji4ORN46T04QRa9amxkYGtbNzZ2C3DoH3zcRByAQm9ZG0Ov1eCSPXen9RJG5jTq5m0flLV9gkM2M+y6oQNWYpqn4yDzWgYMH0Y3J0Lc63pkz2ULmNE0kcblcb5Ugj877efsnIJf3vEUi6+0KxR/E= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 41CBWUcu007913; Mon, 12 Feb 2024 16:36:48 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h= message-id:date:mime-version:subject:to:references:from :in-reply-to:content-type:content-transfer-encoding; s= selector1; bh=8gEun3gan0NwH3ZEsReNc91j0tyU1fUNaMEA9DFe3wc=; b=dZ WL9gteN2ypeb7pm8LH4L+GSDNmjMm1v53a/gvb4W88pivlJoE+02DT5pEAyME6TD f5fJx/ASG2/Z7gTD4LJR5ikx31tkRM6R934bTJczbMCfakBAc2m4mHMuwVslIk4m dwjBGRThOfA+xShXtA49DpQ1C8r8kl0sx6DCl7Cpa93HLizO9uRSBw8cchSL5Xmy unxGp/uCqKFNIeG243eGIijccLQa3f+TniSJN4Qg80gfGCVcL9VtJy50/ebnBuIR LdWszdEhJO8075FgfiJTjdaVH5UbhMUrLn7eLWa4I1D3IYTRG5B3o5UR+bYBA0LI z6C/K6gTz5bz6MQv7w0A== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3w62shq4h2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 12 Feb 2024 16:36:48 +0100 (CET) Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 90CF54002D; Mon, 12 Feb 2024 16:36:43 +0100 (CET) Received: from Webmail-eu.st.com (shfdag1node3.st.com [10.75.129.71]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id C65FF2690A4; Mon, 12 Feb 2024 16:36:33 +0100 (CET) Received: from [10.252.4.188] (10.252.4.188) by SHFDAG1NODE3.st.com (10.75.129.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Mon, 12 Feb 2024 16:36:33 +0100 Message-ID: <42f199ba-8905-4846-9768-54342244610e@foss.st.com> Date: Mon, 12 Feb 2024 16:36:32 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Mismatch between newlib and glibc regarding fileno Content-Language: en-US To: Andrew Pinski , Newlib , Yvan Roux References: <52858367-f116-413e-b107-61c8afce156b@foss.st.com> From: Torbjorn SVENSSON In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.252.4.188] X-ClientProxiedBy: EQNCAS1NODE3.st.com (10.75.129.80) To SHFDAG1NODE3.st.com (10.75.129.71) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-12_12,2024-02-12_03,2023-05-22_02 X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,KAM_SHORT,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 2024-02-09 17:54, Corinna Vinschen wrote: > On Feb 9 08:40, Andrew Pinski wrote: >> On Fri, Feb 9, 2024 at 8:30 AM Torbjorn SVENSSON >> wrote: >>> >>> Hi all, >>> >>> I've been trying to run tests for arm-none-eabi on GCC14 tree. >>> What I've seen is that fileno() is not available. If you look though the >>> header files, I see that this is guarded by __POSIX_VISIBLE and due to a >>> recent change in the GCC testsuite (part of PR96395), they moved the >>> test case to gcc/testsuite/c-c++-common/analyzer/fileno-1.c and then >>> invoke it with g++ and -std=c++98. With this change, strict ANSI is >>> defined, but not __POSIX_VISIBLE. >> >> Note the testcase failure is recorded as https://gcc.gnu.org/PR113278 . >> >>> >>> If I run the same test on the native g++ tool in Ubuntu, I instead get >>> that __USE_POSIX is set (the guard for fileno() in glibc), so this >>> differs from the behavior noticed with newlib. >> >> That is also due to _GNU_SOURCE being defined for C++ for Linux/g++. I >> think this is just a GCC testcase issue rather than something needing >> to be fixed in newlib even. > > Along these lines, note the Linux man page for fileno: > > STANDARDS > POSIX.1-2008. > > HISTORY > POSIX.1-2001. > > and the feature test in GLibc's stdio.h: > > #ifdef __USE_POSIX > /* Return the system file descriptor for STREAM. */ > extern int fileno (FILE *__stream) __THROW __wur; > #endif /* Use POSIX. */ > > > Corinna > Okay, so newlib is more restrictive than glibc on this topic. I will prepare a patch for test cases in GCC with defining _POSIX_SOURCE so that the test cases succeed for newlib. Kind regards, Torbjörn