From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) by sourceware.org (Postfix) with ESMTPS id 8A2C73858417 for ; Fri, 9 Feb 2024 16:40:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8A2C73858417 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8A2C73858417 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::534 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707496818; cv=none; b=tDHCdmoeHKyQcfyf20dAIh9G4P8hMNXydO9F0vOLvj7Xkzf4epaeyGJd3MXIw/UwazQl88nBveFWJJT89lqjotDehn3aOva694fNReK1WNTU94lcKuK6xPAtQY8YLqvZcCkDaLezBu/r5QkLTwCHxgteeXaB5cbGug1ho3yeWvU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707496818; c=relaxed/simple; bh=4vySqmteulMWV+HgQBvGCGsNQAsIhGUzd9g+4CHT65g=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=aVogYnFEbp0v9nn5PhNzqDxv0GkAt8GODfFfiCH+UfH+GaSrR+hM2asAcp876JFluEAyERMAwVHktIA+s8HcuLyVO1A5YtE78WAWw+zB4yhNfiIuRXg0+mryaz0ODs1qV5F15xlVKmBFOHllzzHE4tFwTv9dVwmOiMvVK18mz4o= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pg1-x534.google.com with SMTP id 41be03b00d2f7-5dbd519bde6so802491a12.1 for ; Fri, 09 Feb 2024 08:40:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707496814; x=1708101614; darn=sourceware.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=4vySqmteulMWV+HgQBvGCGsNQAsIhGUzd9g+4CHT65g=; b=LJgoNAEFjNjr2Ept7E9pLn9ZRvsMZdJaPe7JeJ30jfZq/aQ6pBbZVvw1xbt6GmkXoY 8TmM+ieSIbD0o4gEJY7a4br34PyJfvYGy/xtJhlD3MpcVNbPlgC6TP0v3dBNd9XCJ6OI DbAPDzKW1x7YiIgliAGjRzeRKWKO2nE+6oDRHfEThXfig/WbGLStp7a6mT/VcDqz/p6y yuNO/enK+pZWrtVPURaysDSiiiQcB1GoeF9eAKBKbgQ/2gWvKbyPicb4tZST+zH5U+Sm mDixLHe1nXTKu09NznR90az4xuMzWmR3aa3fA+4wip5ifCAy6J6ibk+Jndo+o6omfgVq Mj5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707496814; x=1708101614; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4vySqmteulMWV+HgQBvGCGsNQAsIhGUzd9g+4CHT65g=; b=f60G3Tvfd2xgzncGBAnLNaddHXZox5bnUY/LLa2FIuoCqnniT3KIpK8PQZ7DOYxPHc r5XiUwd1ctVc7VfTwy4NRfAmv14l+Ey+tXvlAImhZDCw/zy0G3zycoqXxwLsqZ0J/5q3 Pel/sbJ1BwpNCizET2I9UyaA34JOF68h45X4c6pAJZBrnwUzTKFTYnGf0HNwr4UhHm9p Eu/cFm1RfMLpiFqvTvC2L6U6yNPJWLC+UwfXKA1eWaWxkvXDDOpNMdqWAOgIu9obdHUG GwaHb6dYPKXoYuT1De6jSvUcAP0ZEo0oydWf1JDpibBwloDzCQClYTxVvuVxOwERwKRu rELQ== X-Gm-Message-State: AOJu0YwF4TR1fBla7P++P6plI49Tko/V5YdhNp+gl5kD17pJcUbsuykC ksLZO4hR9/65QEHMwnmTc4AHdQADMHkIdtZLMZ0KNaSJ1Tgfnqgzuef1NCuVPWHDzl/qDp2XWi2 Vo1G4oBY+gM7LyN8Y6Zac/RkpeC0= X-Google-Smtp-Source: AGHT+IHI9MQk1CrD/F+g03/X5JrxJqEsdazdl1l94mwDZd7z91n0GTwYQRU7SrPG26PUawqjfsWDj1SrIs4O7Xzem3g= X-Received: by 2002:a17:90b:4b10:b0:296:7480:7650 with SMTP id lx16-20020a17090b4b1000b0029674807650mr2227060pjb.26.1707496814436; Fri, 09 Feb 2024 08:40:14 -0800 (PST) MIME-Version: 1.0 References: <52858367-f116-413e-b107-61c8afce156b@foss.st.com> In-Reply-To: <52858367-f116-413e-b107-61c8afce156b@foss.st.com> From: Andrew Pinski Date: Fri, 9 Feb 2024 08:40:02 -0800 Message-ID: Subject: Re: Mismatch between newlib and glibc regarding fileno To: Torbjorn SVENSSON Cc: Newlib , Yvan Roux Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_SHORT,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: On Fri, Feb 9, 2024 at 8:30=E2=80=AFAM 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=3Dc++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. Thanks, Andrew > > > Is it correct that newlib does not define __POSIX_VISIBLE when g++ is > invoked with -std=3Dc++98 (or any other standard that does not use the GN= U > extensions)? > It can also be seen using gcc with -std=3Dc11 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=3Dnewlib-cygwin.git;a=3Dblob;f=3Dnewlib/lib= c/include/sys/features.h;h=3D6a925c87e9ec333fc51538201aa7b52d24b3ca5b;hb=3D= refs/heads/main#l148 > > > Kind regards, > Torbj=C3=B6rn