Re: warning options

2011-11-20 Thread Paul Eggert
On 11/20/11 16:25, Bruno Haible wrote: > "gcc -Wall" produces a warning for > > int f () { return 0; } > int main (void) { return f (1); } That's weird. It doesn't produce a warning for me, for either GCC 4.6.1 (bundled with Fedora 15) or GCC 4.6.2 (which I built): $ cat t.c int f () { retu

Re: declare sethostname if unistd.h doesn't

2011-11-20 Thread Ben Walton
Excerpts from Bruno Haible's message of Sun Nov 20 09:12:55 -0500 2011: Hi Bruno, Thanks for the detailed rundown on this patch. It's nice to get such good feedback. > Yes, the declaration is missing in the Solaris 10 header files, but > also on other platforms that have the function: AIX and O

Re: declare sethostname if unistd.h doesn't

2011-11-20 Thread Ben Walton
Excerpts from Simon Josefsson's message of Sun Nov 20 14:04:42 -0500 2011: Hi Simon, > Have you tested that it resolves the portability issue? If so that is > great. My man page says Solaris uses this prototype: > > int sethostname(char *name, int namelen); I used a modified version of t

Re: warning options

2011-11-20 Thread Bruno Haible
Hi Paul, Thanks for your feedback. > > an empty > > function argument list (in a function definition!) is equivalent to (void). > > It's not equivalent in C, since (void) gives us extra compile-time type > checking that an empty arglist does not. For example, there is no > type error (and no GC

Re: getcwd on AIX

2011-11-20 Thread Bruno Haible
Jim Meyering wrote: > Is there an advantage to using the system getcwd for names > shorter than PATH_MAX, as there is on Solaris and systems with > a linux kernel? (i.e., ability to function in spite of restricted > permissions on a parent directory) Paul Eggert wrote: > The first patch is simpler

Re: getcwd: an old bug fix

2011-11-20 Thread Paul Eggert
Thanks! Please apply.

Re: [PATCH] getcwd-lgpl: fix m4 to match relaxed test for BSD

2011-11-20 Thread Bruno Haible
Eric Blake wrote on 2011-08-17: > gl_FUNC_GETCWD_ABORT_BUG([gl_abort_bug=yes]);; >esac > > - case $gl_cv_func_getcwd_null,$gl_cv_func_getcwd_path_max,$gl_abort_bug in > - *yes,yes,no) ;; > + case > $gl_cv_func_getcwd_null,$gl_cv_func_getcwd_posix_signature$gl_cv_func_getcwd_path_max,$

getcwd: an old bug fix

2011-11-20 Thread Bruno Haible
Since 2009-09-10, there is a small bug in getcwd.m4: it treats gl_cv_func_getcwd_null="guessing yes" like a "no" in one place. This fixes it. 2011-11-20 Bruno Haible getcwd: Fix bug from 2009-09-10. * m4/getcwd.m4 (gl_FUNC_GETCWD): Treat "guessing yes" like "yes", not

Re: manywarnings update

2011-11-20 Thread Jim Meyering
Simon Josefsson wrote: > I have pushed the patch below. For Libtasn1, the only new warning flag > I had to manually disable for that project was -Wsuggest-attribute=pure > because there were many hits and I didn't feel like adding many function > attributes. Unfortunately, several of the paramet

Re: git-version-gen

2011-11-20 Thread Simon Josefsson
Eric Blake writes: > On 11/13/2011 03:18 AM, Simon Josefsson wrote: >>> Yes, since that allows you the freedom to have more tags than just >>> official releases. (I frequently have local tags to intermediate >>> points, but only push official v1.0 style tags upstream, but since the >>> command r

manywarnings update

2011-11-20 Thread Simon Josefsson
I have pushed the patch below. For Libtasn1, the only new warning flag I had to manually disable for that project was -Wsuggest-attribute=pure because there were many hits and I didn't feel like adding many function attributes. Unfortunately, several of the parameters aren't documented in the man

Re: getcwd on AIX

2011-11-20 Thread Paul Eggert
On 11/20/11 11:27, Bruno Haible wrote: > Either of the two following patches fixes it. Which one do you prefer? The first patch is simpler and easier to maintain, so I'd go with it unless there's a performance or correctness reason to go with the second patch. In Solaris, the system getcwd has s

Re: warning options

2011-11-20 Thread Paul Eggert
On 11/20/11 06:58, Bruno Haible wrote: > And -Wtype-limits warnings in dead code are not useful either: I agree with you about this one -- it's been a longrunning problem with GCC. I use -Wno-type-limits when compiling Emacs. I have the problem in non-dead code as well. > an empty > function a

Re: declare sethostname if unistd.h doesn't

2011-11-20 Thread Paul Eggert
On 11/20/11 11:04, Simon Josefsson wrote: > however possibly int and size_t have the same size on all Solaris 8 and > 9 architectures? No, on 64-bit Solaris hosts, int is 32, size_t is 64; this has been true since full 64-bit support was added (Solaris 7 in the late 1990s, if I recall correctly).

Re: Accessing the environment's locale encoding settings

2011-11-20 Thread Bruno Haible
[CCing bug-gnulib. This is a reply to ]. Hi Ludovic, > I’m now convinced that an implicit setlocale(LC_ALL, "") is the right > thing for ‘master’. Good, glad that I could help with my opinion :) > For 2.0, though, this brings

Re: getcwd on AIX

2011-11-20 Thread Jim Meyering
Bruno Haible wrote: > In a testdir for module getcwd, I get this test failure on AIX 5.1, 5.2, 5.3, > 6.1, 7.1: > > FAIL: test-getcwd.sh > > On this platform, configure says: > > checking whether getcwd (NULL, 0) allocates memory for result... no > checking for getcwd with POSIX signature...

Re: declare sethostname if unistd.h doesn't

2011-11-20 Thread Bruno Haible
Simon Josefsson wrote: > I support installing this if it does something useful on at > least some (Solaris) machine, since the current situation does not > appear to work on any (Solaris) machine. I'm in favour of doing it using the normal Gnulib style - one module per POSIX or glibc function. And

Re: [PATCH] tests: factor st_ctime-comparison out of two headers

2011-11-20 Thread Ben Pfaff
Simon Josefsson writes: > Ben Pfaff writes: > >> Simon Josefsson writes: >> >>> Bruno Haible writes: >>> Jim Meyering wrote: > -W >>> ... > -Wwrite-strings > -fdiagnostics-show-option Thanks. I've updated my build script to include these for glibc/x86 builds (ex

getcwd on AIX

2011-11-20 Thread Bruno Haible
Hi, In a testdir for module getcwd, I get this test failure on AIX 5.1, 5.2, 5.3, 6.1, 7.1: FAIL: test-getcwd.sh On this platform, configure says: checking whether getcwd (NULL, 0) allocates memory for result... no checking for getcwd with POSIX signature... yes checking whether getcwd

Re: declare sethostname if unistd.h doesn't

2011-11-20 Thread Simon Josefsson
Ben Walton writes: > Hi All, > > When testing the pending release of inetutils on solaris 9/10, I > discovered that sethostname isn't declared in unistd.h on Solaris. > The following patch adds handling for this although I'm not positive > that it's the best way to do it. At the very least it's

Re: [PATCH] tests: factor st_ctime-comparison out of two headers

2011-11-20 Thread Jim Meyering
Simon Josefsson wrote: ... > A combination of the two approaches that I've used is this: > > if test "$gl_gcc_warnings" = yes; then > gl_WARN_ADD([-Werror], [WERROR_CFLAGS]) > gl_WARN_ADD([-Wframe-larger-than=112], [WSTACK_CFLAGS]) > > nw="$nw -Wsystem-headers" # Don't let system head

Re: [PATCH] tests: factor st_ctime-comparison out of two headers

2011-11-20 Thread Peter Johansson
On 11/20/11 1:49 PM, Simon Josefsson wrote: > Another approach is to add -Werror last (this is what Eric Blake > suggested on the autoconf mailing list a long time ago), e.g.: > > AC_DEFUN([OVS_ENABLE_WERROR], > [AC_ARG_ENABLE( >[Werror], >[AC_HELP_STRING([--enable-Werror],

Re: [PATCH] tests: factor st_ctime-comparison out of two headers

2011-11-20 Thread Simon Josefsson
Ben Pfaff writes: > Simon Josefsson writes: > >> Bruno Haible writes: >> >>> Jim Meyering wrote: -W >> ... -Wwrite-strings -fdiagnostics-show-option >>> >>> Thanks. I've updated my build script to include these for glibc/x86 builds >>> (except -Werror, which causes a configuratio

Re: warning options

2011-11-20 Thread Bruno Haible
I wrote: > Thanks. I've updated my build script to include these for glibc/x86 builds > (except -Werror, which causes a configuration error already in > "checking whether the compiler works..."). But now I see the warnings coming out. I won't use -Wold-style-definition and -Wstrict-prototypes bec

utimens test failures

2011-11-20 Thread Bruno Haible
Hi Eric, Jim, In a testdir created through ./gnulib-tool --create-testdir --dir=/tmp/testdir --with-tests \ --single-configure futimens I can see these test failures: * AIX 5.1, HP-UX 11.00, IRIX 6.5, Solaris 7..9 test-utimens.h:83: assertion failed FAIL: test-utimens

Re: declare sethostname if unistd.h doesn't

2011-11-20 Thread Bruno Haible
Hi Ben, > When testing the pending release of inetutils on solaris 9/10, I > discovered that sethostname isn't declared in unistd.h on Solaris. > The following patch adds handling for this although I'm not positive > that it's the best way to do it. At the very least it's a starting > point for d