NetBSD Problem Report #57810

From www@netbsd.org  Tue Jan  2 00:38:39 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))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id B89B41A9238
	for <gnats-bugs@gnats.NetBSD.org>; Tue,  2 Jan 2024 00:38:39 +0000 (UTC)
Message-Id: <20240102003838.6A32F1A9239@mollari.NetBSD.org>
Date: Tue,  2 Jan 2024 00:38:38 +0000 (UTC)
From: campbell+netbsd@mumble.net
Reply-To: campbell+netbsd@mumble.net
To: gnats-bugs@NetBSD.org
Subject: stdlib.h is unusable under _ANSI_SOURCE and _POSIX_C_SOURCE together
X-Send-Pr-Version: www-1.0

>Number:         57810
>Category:       standards
>Synopsis:       stdlib.h is unusable under _ANSI_SOURCE and _POSIX_C_SOURCE together
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    standards-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jan 02 00:40:00 +0000 2024
>Originator:     Taylor R Campbell
>Release:        current
>Organization:
The _NETBSD_SOURCE Foundation
>Environment:
>Description:
Defining _ANSI_SOURCE and _POSIX_C_SOURCE breaks stdlib.h.
>How-To-Repeat:
$ cat pr.c
#define	_ANSI_SOURCE
#define	_POSIX_C_SOURCE	200809L
#include <stdlib.h>
$ make pr.o
cc -O2   -c pr.c
In file included from pr.c:3:0:
/usr/include/stdlib.h:227:1: error: unknown type name ‘lldiv_t’; did you mean ‘ldiv_t’?
 lldiv_t  lldiv(long long int, long long int);
 ^~~~~~~
 ldiv_t
*** Error code 1

Stop.
make: stopped in /tmp/riastradh

>Fix:
Yes, please!

It looks like the conditions for defining lldiv_t don't quite match the conditions for declaring lldiv in stdlib.h; making them match should resolve the issue.

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.