Excerpts from Bruno Haible's message of Sun Dec 04 13:45:51 -0500 2011:
Hi Bruno,
> You have been misunderstanding how the C and C++ macro expansion
> process works. The only place where a space before the open
> parenthesis is not allowed is in the *definition* of a macro with
> arguments, like
Ben Walton wrote:
> In one of the subsequent tweaks to this test, you restored a space
> between the function name and the emtpy () at the call site for
> geteuid. I realize I let some foo() slip through so it's
> understandable that you were doing a bunch of corrections. Will this
> not break th
Excerpts from Bruno Haible's message of Sat Dec 03 08:50:37 -0500 2011:
Hi Bruno,
> > +#if !HAVE_GETEUID
> > +# define geteuid() ((uid_t) -1)
> > +#endif
>
> Wow! You have thought at many things. You did it better than if I had
> written this test.
I saw a similar trick somewhere else in gnulib
Ben Walton wrote:
> Provide a module that tests the functionality of sethostname().
I have verified that the test 2 is skipped for non-root users and succeeds
for root users on Linux/glibc 2.11, MacOS X 10.5, Solaris 11 2010-11,
Minix 3.1.8, and that the hostname is correctly restored when the tes
Ben Walton wrote:
> + ASSERT(gethostname (origname, sizeof (origname)) == 0);
On mingw, I'm seeing a warning and link error:
test-sethostname.c: In function `main':
test-sethostname.c:62: warning: implicit declaration of function `gethostname'
...
test-sethostname.o: In function `main':
/home/br
Ben Walton wrote:
> +#if !HAVE_GETEUID
> +# define geteuid() ((uid_t) -1)
> +#endif
On mingw, I'm getting a compilation error:
test-sethostname.c: In function `main':
test-sethostname.c:58: error: `uid_t' undeclared (first use in this function)
test-sethostname.c:58: error: (Each undeclared ident
Ben Walton wrote:
> + int rcg, rcs, i;
I'm getting a warning
test-sethostname.c: In function ‘main’:
test-sethostname.c:52:7: warning: unused variable ‘rcg’ [-Wunused-variable]
The fix is obvious.
2011-12-03 Bruno Haible
sethostname tests: Avoid a gcc warning.
* tests/test
Ben Walton wrote:
> Provide a module that tests the functionality of sethostname().
Thanks, I'm applying this as well.
> Signed-off-by: Ben Walton
> ---
> ChangeLog |6 ++
> modules/sethostname-tests | 13 +
> tests/test-sethostname.c | 117
> +++
Provide a module that tests the functionality of sethostname().
Signed-off-by: Ben Walton
---
ChangeLog |6 ++
modules/sethostname-tests | 13 +
tests/test-sethostname.c | 117 +
3 files changed, 136 insertions(+), 0 deletio