From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) by sourceware.org (Postfix) with ESMTPS id 9A9FA3858404 for ; Fri, 9 Feb 2024 16:29:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9A9FA3858404 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 9A9FA3858404 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=185.132.182.106 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707496201; cv=none; b=MOQiUCsruSYgIOwAjHmyA2cRTBaQDk5FCNzHX02nePQTtqML3LjIUfqyH/ebZJ/ZnGRwq7BtruFStKlwdJSLkj4ojQr/9MtlG/QO70o3OKTAmTn6cu3PzEK18skEy5d4iqa3OEk0H0HDisIZtLWprgJJbi7UcGSimyDGsTmOITk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707496201; c=relaxed/simple; bh=Pyp1KLWMjJrAQGxN1JwOyQBBNKvWUwuPRHgF741VAPg=; h=DKIM-Signature:Message-ID:Date:MIME-Version:From:To:Subject; b=RaXoeuk5BGcFZUjWvjVyClARYS7XxLuu9Hi3sp96heaFyDg7tlD6eRdK/LfTzu74T5Vlsg6uMvnUDBafpfq0BLwIIg4iS9Yoky0AhxOXty0XIUaa3A0a2CepZl+Hlhuw/knF9SvdehxqTdIS6/2mP4+RrcTl7FQ/J0fEKQXHJSs= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0288072.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 419CXUUL011985 for ; Fri, 9 Feb 2024 17:29:58 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h= message-id:date:mime-version:from:to:cc:subject:content-type :content-transfer-encoding; s=selector1; bh=Hm/LWQLCU7aWNP8+DT7X AImw02w7NPjfzgLMSK7z5Ak=; b=bmAiuMmsk5AB7o71VIh12tgG6LHiWWRm+Q8P 4kH0xHGF9xKt9vg280fkN7i0VhQ1C2o6u6IPyMIUhBIOjBKMRDXOwgULq0dQIoRn NpCl6D6QRGYiyJsabWMDCQFO0J2+96kHa9dqdLumT1kJQHCCFyvfDZsMYJm0EDm2 2n9B4u0QWrsim0MbjGXgjg5+VrP0t8tWHFHCMYnyprpbFI0O3LXCWdSN0T/qxvmG QrQiV5Yj1NRMuBJpjGqvLprDaFzrQR9J/A4m/T2pbiF/qEmOS9PIO/uvbCCxJcBQ ZsQgMaPdFD1Nfnaqtu5SWxGi3I7zAfCsOpBJWY7/RfUU+UiB0A== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3w1eyptq5c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 09 Feb 2024 17:29:58 +0100 (CET) Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id CB03510004F for ; Fri, 9 Feb 2024 17:29:57 +0100 (CET) Received: from Webmail-eu.st.com (shfdag1node3.st.com [10.75.129.71]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 8F0F82721C7 for ; Fri, 9 Feb 2024 17:29:57 +0100 (CET) Received: from [10.252.18.136] (10.252.18.136) 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; Fri, 9 Feb 2024 17:29:57 +0100 Message-ID: <52858367-f116-413e-b107-61c8afce156b@foss.st.com> Date: Fri, 9 Feb 2024 17:29:56 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US From: Torbjorn SVENSSON To: Newlib CC: Yvan Roux Subject: Mismatch between newlib and glibc regarding fileno Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.252.18.136] 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-09_14,2024-02-08_01,2023-05-22_02 X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,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: 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. 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. Is it correct that newlib does not define __POSIX_VISIBLE when g++ is invoked with -std=c++98 (or any other standard that does not use the GNU extensions)? It can also be seen using gcc with -std=c11 for example, so it's not strictly a C vs C++ issue. The expression used in glibc: https://github.com/bminor/glibc/blob/master/include/features.h#L335 The expression used in newlib: https://sourceware.org/git/?p=newlib-cygwin.git;a=blob;f=newlib/libc/include/sys/features.h;h=6a925c87e9ec333fc51538201aa7b52d24b3ca5b;hb=refs/heads/main#l148 Kind regards, Torbjörn