From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 1200A3858403 for ; Fri, 9 Feb 2024 16:54:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1200A3858403 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 1200A3858403 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707497646; cv=none; b=e+IO2Wo8nis0RAuO6ZRFGEBBzNsrjDJSyxpzOBnE7Ri/4CJNxZL8mIbYbUajVPADFV5tszUrBm6h8GK/ZpypA2AcQyUsN7OvrAIanW59C9aJToZ+6PzR1Zqj4ORApPDZ1zAiF/3bhx8sFkwrAV0A3y01le/j2VWGhnXbFMBJ9U4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707497646; c=relaxed/simple; bh=T9vNzqYpue1DardUbm0dUXEm1Gl4t8lqIn1PSAXoah8=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=pATMOYul1+PUjYoRw9KfRdeACqy+KGK63Tsf+cq1A4nO7NkqNhNTxekct+ZMI8mE9uDBaT6RRI5Ylc+O4z4n5ARBW9Ei888ve7gXnKzEByiFp4VJgCzHE/1u2iPLHMg3pPNu7QF65GeUh/3AI3MtcTC83SGXR/+PxZJhQI1pp1w= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707497644; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FrQgTSmczfZ44rub6kdQmY1yAxf2R01tjtZOJJpcha8=; b=OVfX1WiRPmfmVk3ZNSsxdmwJfRtN4KeBCBmIWMR1FRJoV2mbRjbKqXsZDGLFrqQzSDf5SB ew4K0/5pDsi8m/8oX4TNUTV+SJZqs5NDSRbcBt7AxN2AKaTZpKsrZ3DozWuGNecmDqcOK4 eOB3rFThriOQ9BTcc2ShEBriJYHVPfE= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-461-TCghGua4P9SbZwWMwuil7g-1; Fri, 09 Feb 2024 11:54:03 -0500 X-MC-Unique: TCghGua4P9SbZwWMwuil7g-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C3BBB84ACA0; Fri, 9 Feb 2024 16:54:02 +0000 (UTC) Received: from calimero.vinschen.de (unknown [10.39.192.85]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A156F492BC6; Fri, 9 Feb 2024 16:54:01 +0000 (UTC) Received: by calimero.vinschen.de (Postfix, from userid 500) id 58A3DA809E4; Fri, 9 Feb 2024 17:54:00 +0100 (CET) Date: Fri, 9 Feb 2024 17:54:00 +0100 From: Corinna Vinschen To: Andrew Pinski Cc: Torbjorn SVENSSON , Newlib , Yvan Roux Subject: Re: Mismatch between newlib and glibc regarding fileno Message-ID: Reply-To: newlib@sourceware.org Mail-Followup-To: Andrew Pinski , Torbjorn SVENSSON , Newlib , Yvan Roux References: <52858367-f116-413e-b107-61c8afce156b@foss.st.com> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_SHORT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,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 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