NetBSD Problem Report #57810

From  Tue Jan  2 00:38:39 2024
Return-Path: <>
Received: from ( [])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "", Issuer " CA" (not verified))
	by (Postfix) with ESMTPS id B89B41A9238
	for <>; Tue,  2 Jan 2024 00:38:39 +0000 (UTC)
Message-Id: <>
Date: Tue,  2 Jan 2024 00:38:38 +0000 (UTC)
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
The _NETBSD_SOURCE Foundation
Defining _ANSI_SOURCE and _POSIX_C_SOURCE breaks stdlib.h.
$ 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);
*** Error code 1

make: stopped in /tmp/riastradh

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:,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2024 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.