NetBSD Problem Report #55577

From www@netbsd.org  Fri Aug 14 20:15:03 2020
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id B40851A9239
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 14 Aug 2020 20:15:02 +0000 (UTC)
Message-Id: <20200814201501.A49611A9246@mollari.NetBSD.org>
Date: Fri, 14 Aug 2020 20:15:01 +0000 (UTC)
From: coypu@sdf.org
Reply-To: coypu@sdf.org
To: gnats-bugs@NetBSD.org
Subject: locale_t not defined if _XOPEN_SOURCE is defined
X-Send-Pr-Version: www-1.0

>Number:         55577
>Category:       standards
>Synopsis:       locale_t not defined if _XOPEN_SOURCE is defined
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    standards-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Aug 14 20:20:00 +0000 2020
>Closed-Date:    Fri Oct 11 18:55:52 +0000 2024
>Last-Modified:  Fri Oct 11 18:55:52 +0000 2024
>Originator:     coypu
>Release:        NetBSD 9.99.69
>Organization:
>Environment:
NetBSD planets 9.99.69 NetBSD 9.99.69 (GENERIC) #0: Tue Jul 21 19:50:57 IDT 2020  fly@planets:/home/fly/obj/sys/arch/amd64/compile/GENERIC amd64

>Description:
> cat test.c
#define _XOPEN_SOURCE 700
#include <locale.h>
#include <stdio.h>
int main() {
	printf("%d\n", sizeof(locale_t));
	return 0;
}

> gcc test.c 
test.c: In function ‘main’:
test.c:5:24: error: ‘locale_t’ undeclared (first use in this function); did you mean ‘localeconv’?
  printf("%d\n", sizeof(locale_t));
                        ^~~~~~~~
                        localeconv
test.c:5:24: note: each undeclared identifier is reported only once for each function it appears in

>How-To-Repeat:

>Fix:

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->needs-pullups
State-Changed-By: riastradh@NetBSD.org
State-Changed-When: Mon, 09 Sep 2024 14:32:43 +0000
State-Changed-Why:
fixed in HEAD, needs pullup-10, pullup-9


From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/55577 CVS commit: src/sys/sys
Date: Mon, 9 Sep 2024 15:05:39 +0000

 Module Name:	src
 Committed By:	riastradh
 Date:		Mon Sep  9 15:05:39 UTC 2024

 Modified Files:
 	src/sys/sys: featuretest.h

 Log Message:
 sys/featuretest.h: Define _POSIX_C_SOURCE according to _XOPEN_SOURCE.

 If _XOPEN_SOURCE is defined but _POSIX_C_SOURCE is not, there is a
 corresponding value of _POSIX_C_SOURCE that _XOPEN_SOURCE is supposed
 to be equivalent to.  We could sprinkle conditionals for
 _XOPEN_SOURCE everywhere we already have conditionals for
 _POSIX_C_SOURCE, like in <locale.h>, but it's simpler and more
 reliable to simply define _POSIX_C_SOURCE based on _XOPEN_SOURCE in
 one place.

 PR standards/55577: locale_t not defined if _XOPEN_SOURCE is defined


 To generate a diff of this commit:
 cvs rdiff -u -r1.12 -r1.13 src/sys/sys/featuretest.h

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: needs-pullups->pending-pullups
State-Changed-By: riastradh@NetBSD.org
State-Changed-When: Fri, 11 Oct 2024 15:47:21 +0000
State-Changed-Why:
pullup-10 #949 https://releng.netbsd.org/cgi-bin/req-10.cgi?show=949


From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/55577 CVS commit: [netbsd-10] src/sys/sys
Date: Fri, 11 Oct 2024 18:51:21 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Fri Oct 11 18:51:21 UTC 2024

 Modified Files:
 	src/sys/sys [netbsd-10]: featuretest.h

 Log Message:
 Pull up following revision(s) (requested by riastradh in ticket #949):

 	sys/sys/featuretest.h: revision 1.13

 sys/featuretest.h: Define _POSIX_C_SOURCE according to _XOPEN_SOURCE.

 If _XOPEN_SOURCE is defined but _POSIX_C_SOURCE is not, there is a
 corresponding value of _POSIX_C_SOURCE that _XOPEN_SOURCE is supposed
 to be equivalent to.  We could sprinkle conditionals for
 _XOPEN_SOURCE everywhere we already have conditionals for
 _POSIX_C_SOURCE, like in <locale.h>, but it's simpler and more
 reliable to simply define _POSIX_C_SOURCE based on _XOPEN_SOURCE in
 one place.

 PR standards/55577: locale_t not defined if _XOPEN_SOURCE is defined


 To generate a diff of this commit:
 cvs rdiff -u -r1.10 -r1.10.66.1 src/sys/sys/featuretest.h

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: pending-pullups->closed
State-Changed-By: riastradh@NetBSD.org
State-Changed-When: Fri, 11 Oct 2024 18:55:52 +0000
State-Changed-Why:
fixed in HEAD, pulled up to 10, risk to 9 is probably not worth it


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(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.