This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Re: getcwd() problem
- To: Yasushi Higuchi <yzone at mail dot raidway dot ne dot jp>
- Subject: Re: getcwd() problem
- From: egor duda <deo at logos-m dot ru>
- Date: Fri, 5 Oct 2001 16:23:52 +0400
- CC: cygwin at cygwin dot com
- Organization: deo
- References: <200110051213.VAA12158@mail.raidway.ne.jp>
- Reply-To: egor duda <cygwin at cygwin dot com>
Hi!
Friday, 05 October, 2001 Yasushi Higuchi yzone@mail.raidway.ne.jp wrote:
YH> I found a problem in the getcwd() function in recent snapshot.
[...]
>> char *cwd = getcwd(NULL, 256);
[...]
Single Unix Specification v2 says that "If buf is a null pointer, the
behaviour of getcwd() is undefined."
YH> Reference: FreeBSD manpages
>>STANDARDS
>>The getcwd() function conforms to ISO 9899: 1990 (``ISO C''). The ability
>>to specify a NULL pointer and have getcwd() allocate memory as necessary
>>is an extension.
cygwin doesn't support this extension. it's arguable whether it should
be added or not. code that implicitly allocates (on doesn't allocate,
depending in parameters) memory on heap is a source of potential
memory leaks.
Egor. mailto:deo@logos-m.ru ICQ 5165414 FidoNet 2:5020/496.19
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/