NetBSD Problem Report #58794
From www@netbsd.org Wed Oct 30 19:34:49 2024
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature RSA-PSS (2048 bits)
client-signature RSA-PSS (2048 bits))
(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id B07DD1A9238
for <gnats-bugs@gnats.NetBSD.org>; Wed, 30 Oct 2024 19:34:48 +0000 (UTC)
Message-Id: <20241030193447.9FE4B1A923B@mollari.NetBSD.org>
Date: Wed, 30 Oct 2024 19:34:47 +0000 (UTC)
From: campbell+netbsd@mumble.net
Reply-To: campbell+netbsd@mumble.net
To: gnats-bugs@NetBSD.org
Subject: fenv.h leaks <m68k/fpreg.h> into the namespace
X-Send-Pr-Version: www-1.0
>Number: 58794
>Category: port-m68k
>Synopsis: fenv.h leaks <m68k/fpreg.h> into the namespace
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: port-m68k-maintainer
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Oct 30 19:35:00 +0000 2024
>Originator: Taylor R Campbell
>Release: current, 10, 9, ...
>Organization:
The M68kBSD Fenvation
>Environment:
>Description:
For the definitions of the floating-point exception bits and rounding modes FE_*, m68k fenv.h includes <m68k/fpreg.h> which defines various FPSR_* and FPCR_* constants. This namespace pollution is not allowed by C99; the numbers should be copied, or the names defined by <m68k/fpreg.h> and used by fenv.h should be _FPSR_*/_FPCR_* or __FPSR_*/__FPCR_* so they are reserved to the implementation by the standard.
>How-To-Repeat:
1. code inspection
2. write a program that defines its own constants FPSR_*/FPCR_* which aren't token-by-token identical to the NetBSD ones
>Fix:
Yes, please!
(Contact us)
$NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2024
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.