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 12D4A3858C56 for ; Mon, 12 Feb 2024 16:40:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 12D4A3858C56 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 12D4A3858C56 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=1707756018; cv=none; b=Zxy6DjS1ilnSC5F6UPd19PyARI4Xj3HsPEiI61Hr6t/9OOiz/vz2pRu3QmJTSsrJsU/rYV51z3Gx3Oi8m/iNq0db/mjwlpwE0rumq9uV7gNlCJ6a0c22fYEN9mdfoZND+3UWIK4uVUrlaCbvWVhoqfl/QqfDjmrlF+q0i1wR3wM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707756018; c=relaxed/simple; bh=LN9CyHEQDNRiGh1qtPpWpeFg7zpvVrTIdgj5D2R2vAw=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=ICXLOIrCQusocA+td1ESlL+J3UTnvrgU52NOMPk8lMhzP/T0eLKS+WyhCz0KHOUY+hS/t3a3Pw53u6R3hYj769Ho3NAIrFEmAAA0n8DDRwCLtBD8KBIsB8ZcgIsUXMoV97zFD6CN3DYv3CyulZ2XFFTmWxAAFpgztpWKVbuQntU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707756016; 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:in-reply-to:in-reply-to: references:references; bh=kqFXmSaNm0MNz7qr2nJOYafcjEEh8+PsUlh6OZ7DAH4=; b=Sl8xvk4rgsJrUax3fj45BpHq76j9Ni1eso5V546H0MYIYwBocsuoc81KX0ZEbcVqFbXJ++ lVUcQOWX+4OYHFZ7TS4mKxi2qDjUK01uPpB8LexpRBQHRYiGUsISncj6COxUO3pVtY29mL CUsoecsukknv4BQ9magVjB31dwjCgn0= 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-121-tNGgjLM7MYCWWInEmP7wnw-1; Mon, 12 Feb 2024 11:40:11 -0500 X-MC-Unique: tNGgjLM7MYCWWInEmP7wnw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (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 42CD910230FE; Mon, 12 Feb 2024 16:40:11 +0000 (UTC) Received: from calimero.vinschen.de (unknown [10.39.195.74]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 208E72166B31; Mon, 12 Feb 2024 16:40:11 +0000 (UTC) Received: by calimero.vinschen.de (Postfix, from userid 500) id 0A46EA80345; Mon, 12 Feb 2024 17:40:10 +0100 (CET) Date: Mon, 12 Feb 2024 17:40:10 +0100 From: Corinna Vinschen To: Torbjorn SVENSSON Cc: Andrew Pinski , Newlib , Yvan Roux Subject: Re: Mismatch between newlib and glibc regarding fileno Message-ID: Reply-To: newlib@sourceware.org Mail-Followup-To: Torbjorn SVENSSON , Andrew Pinski , Newlib , Yvan Roux References: <52858367-f116-413e-b107-61c8afce156b@foss.st.com> <42f199ba-8905-4846-9768-54342244610e@foss.st.com> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 12 17:33, Corinna Vinschen wrote: > On Feb 12 16:36, Torbjorn SVENSSON wrote: > > 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. > > It looks like it. But I do wonder if that's really intended by glibc. > I ran a quick test, first under newlibL > > $ g++ -std=c++98 -E -dM /usr/include/features.h | grep VISIBLE > #define __LARGEFILE_VISIBLE 0 > #define __ISO_C_VISIBLE 1999 > #define __XSI_VISIBLE 0 > #define __GNU_VISIBLE 0 > #define __BSD_VISIBLE 0 > #define __POSIX_VISIBLE 0 > #define __SVID_VISIBLE 0 > #define __ATFILE_VISIBLE 0 > #define __MISC_VISIBLE 0 > > then under glibc: > > $ g++ -std=c++98 -E -dM x.cc | grep '#define __USE' > #define __USE_UNIX98 1 > #define __USE_FORTIFY_LEVEL 0 > #define __USE_ISOC11 1 > #define __USE_ISOC95 1 > #define __USE_ISOC99 1 > #define __USE_XOPEN 1 > #define __USE_XOPEN2K 1 > #define __USE_POSIX199506 1 > #define __USE_GNU 1 > #define __USE_XOPEN2KXSI 1 > #define __USE_XOPEN2K8 1 > #define __USE_POSIX 1 > #define __USER_LABEL_PREFIX__ > #define __USE_MISC 1 > #define __USE_POSIX2 1 > #define __USE_LARGEFILE64 1 > #define __USE_POSIX199309 1 > #define __USE_XOPEN2K8XSI 1 > #define __USE_LARGEFILE 1 > #define __USE_XOPEN_EXTENDED 1 > #define __USE_DYNAMIC_STACK_SIZE 1 > #define __USE_ATFILE 1 > > How is it possible that with -std=c++98, everything and the kitchen sink > is enabled? Is that really correct?!? ...especially since __STRICT_ANSI__ is defined to 1 in this scenario. Corinna