Re: in-memory representation of NULL pointers?

2010-04-23 Thread Ben Pfaff
Paul Eggert writes: > Here is that macro's implementation, in case you don't want to bother to > look it up: > > /* With -Dlint, avoid warnings from gcc about code like mbstate_t m = {0,}; >by wasting space on a static variable of the same type, that is thus >guaranteed to be initialized

Re: [PATCH 1/2] open_memstream-tests: new module

2010-04-23 Thread Eric Blake
On 04/23/2010 05:21 PM, Paul Eggert wrote: > Eric Blake writes: > >> + ASSERT (STREQ (buf, "hello my world")); >> + ASSERT (len = strlen (buf)); > > These two tests, plus some others, assume that open_memstream allocates > a buffer in which the output is NUL-terminated. This isn't a portable

Re: [PATCH 1/2] open_memstream-tests: new module

2010-04-23 Thread Paul Eggert
Eric Blake writes: > + ASSERT (STREQ (buf, "hello my world")); > + ASSERT (len = strlen (buf)); These two tests, plus some others, assume that open_memstream allocates a buffer in which the output is NUL-terminated. This isn't a portable assumption (though it is often true, which I expect is

[PATCH 2/2] open_memstream: new module

2010-04-23 Thread Eric Blake
Implement a light-weight replacement for BSD variants that provide funopen() as a way to hook stdio (comparable to glibc's fopencookie). Tested on FreeBSD 8.0. Fails to compile on other platforms, like Solaris, cygwin 1.5, and mingw. * modules/open_memstream: New file. * m4/open_memstream.m4 (gl

[PATCH] vc-list-files: Add support for subversion

2010-04-23 Thread Giuseppe Scrivano
A small patch. Cheers, Giuseppe >From 3ac0d82429aa45c9360109a51af26ed3e338430f Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Sat, 24 Apr 2010 00:46:29 +0200 Subject: [PATCH] vc-list-files: Add support for subversion * build-aux/vc-list-files: Use "svn list" to generate the list of fi

Re: in-memory representation of NULL pointers?

2010-04-23 Thread Paul Eggert
>>> I believe there is a bunch of places in gnulib which uses memset(P, 0, >>> sizeof(P)) to initialize structures containing pointers, which wouldn't >>> be OK if this is not the case. >> >> However, GNU Coding Standards states that we can assume that all >> platforms worth porting to obey the ind

work in progress: [PATCH 0/2+] open_memstream

2010-04-23 Thread Eric Blake
The libvirt project would be very interested in using open_memstream, since it is now part of POSIX 2008. We even tossed around an idea on IRC on how to implement it for mingw, details below. For now, I've got a test working on Linux and cygwin 1.7 as the golden reference (two independent impleme

[PATCH 1/2] open_memstream-tests: new module

2010-04-23 Thread Eric Blake
Test passes on Linux and cygwin 1.7, but fails everywhere that open_memstream is not implemented. * modules/open_memstream-tests: New file. * tests/test-open_memstream.c: Likewise. Signed-off-by: Eric Blake --- ChangeLog|6 modules/open_memstream-tests | 12 ++

Re: Gnulib 64-bit ABI bug with OSX, generic patch proposed

2010-04-23 Thread Paul Eggert
Jarno Rajahalme writes: > So it seems that the aim is for the gnulib/stdint.h types and the > macros be consistent with the system versions. If so, why not use the > system versions for defining them, if they exist? Because the system versions are often wrong. gnulib/m4/stdint.m4 contains a fai

Re: in-memory representation of NULL pointers?

2010-04-23 Thread Simon Josefsson
Eric Blake writes: > On 04/23/2010 11:27 AM, Simon Josefsson wrote: >> Not gnulib specific, but related to our coding style: >> >> Does POSIX somewhere guarantee that the in-memory representation of NULL >> pointers is 0? I know that C89 doesn't make that guarantee, and that >> some historic sy

Re: in-memory representation of NULL pointers?

2010-04-23 Thread Eric Blake
On 04/23/2010 11:27 AM, Simon Josefsson wrote: > Not gnulib specific, but related to our coding style: > > Does POSIX somewhere guarantee that the in-memory representation of NULL > pointers is 0? I know that C89 doesn't make that guarantee, and that > some historic systems used non-0 memory valu

in-memory representation of NULL pointers?

2010-04-23 Thread Simon Josefsson
Not gnulib specific, but related to our coding style: Does POSIX somewhere guarantee that the in-memory representation of NULL pointers is 0? I know that C89 doesn't make that guarantee, and that some historic systems used non-0 memory values to represent NULL, but I'm hoping that this is not per

[PATCH] vc-list-files tests: convert to use init.sh

2010-04-23 Thread Jim Meyering
FYI, this converts a couple more test scripts to use init.sh: >From 1b260c90384d91ca9b211670b705ed671aff26c7 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Fri, 23 Apr 2010 11:38:35 +0200 Subject: [PATCH] vc-list-files tests: convert to use init.sh * tests/test-vc-list-files-cvs.sh: Invoke "$

Re: [PATCH] top/maint.mk (sc_prohibit_backup_files): Prohibit checked in backup files.

2010-04-23 Thread Jim Meyering
Simon Josefsson wrote: > I've pushed this -- I noticed I had some backup files in version control > in more than one project, and adding a syntax-check to catch similar > problems globally seemed useful to me. Thanks. That does look useful.

Re: test-string-c++.o:(.data+0x0): undefined reference to `rpl_memchr'

2010-04-23 Thread Simon Josefsson
Bruno Haible writes: >> g++ -o test-string-c++.exe test-string-c++.o test-string-c++2.o >> ../gllib/libgnu.a >> test-string-c++.o:(.data+0x0): undefined reference to `rpl_memchr' > > Why is CXX="g++" being used when you are cross-compiling from linux to mingw?? Ah, that's the problem. >