[PATCH] doc: update users.txt

2011-02-15 Thread Jim Meyering
I've moved the git repo for iwhd. This updates its URL: >From bf2664dc000e0bd9c460b8fa6297dcfe7d8fa9ef Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 15 Feb 2011 10:41:00 +0100 Subject: [PATCH] doc: update users.txt * users.txt: Update iwhd's URL. --- ChangeLog |5 + users.txt

proposed getloadavg patch to trim unused parts and speed up 'configure'

2011-02-15 Thread Paul Eggert
In modifying GNU Emacs to use getloadavg I noticed that configuring getloadavg takes too much time, and that this isn't needed. I propose the following patch. It removes support for ancient features that I think nobody needs any more, namely, getloadavg implementations that require setgid use, al

Re: getloadavg test

2011-02-15 Thread Bruno Haible
Hi Paul, > Move test code to ... > * tests/test-getloadavg.c: New file, containing previous > contents of test from lib/getloadavg.c. > * modules/getloadavg-tests: New file. This test can be run in two modes: - simple test: call getloadavg once, and print one line. - repeated test: call getlo

Re: getloadavg and errno

2011-02-15 Thread Bruno Haible
Hi Paul, Jim, > + errno = 0;/* Don't be misled if it doesn't set errno. > */ > + loads = getloadavg (avg, 3); > + if (loads == -1) > +{ > + perror ("Skipping test; load average not supported"); > + return 77; > +} This assignment

Re: getloadavg and errno

2011-02-15 Thread Jim Meyering
Bruno Haible wrote: > Hi Paul, Jim, > >> + errno = 0;/* Don't be misled if it doesn't set errno. >> */ >> + loads = getloadavg (avg, 3); >> + if (loads == -1) >> +{ >> + perror ("Skipping test; load average not supported"); >> + return 77;

Re: [PATCH] vasnprintf: silence some clang false positives

2011-02-15 Thread Eric Blake
On 02/14/2011 07:11 PM, Bruno Haible wrote: > Hi Eric, > >> Bruno, would you be okay with this patch? > >> +* lib/vasnprintf.c (VASNPRINTF) [ENSURE_ALLOCATION]: Teach clang >> +that ENSURE_ALLOCATION guarantees a non-null result. > >> +else if (!result)

Re: [PATCH] vasnprintf: silence some clang false positives

2011-02-15 Thread Paul Eggert
On 02/15/2011 07:40 AM, Eric Blake wrote: > # if STATIC_ANALYSIS > # undef NDEBUG /* Don't let a prior NDEBUG definition cause trouble. */ > # include > # define sa_assert(expr) assert (expr) > # else > # define sa_assert(expr) /* empty */ > # endif It doesn't feel right that sa_assert uses

Re: [PATCH] vasnprintf: silence some clang false positives

2011-02-15 Thread Ben Pfaff
Paul Eggert writes: > If we want to do this sort of thing, I suggest using a different > name for the static analysis macro, a name that more > obviously differs from "assert (X)". How about "assume (X)"? invariant (X)? -- Ben Pfaff http://benpfaff.org

Re: [PATCH] vasnprintf: silence some clang false positives

2011-02-15 Thread Jim Meyering
Ben Pfaff wrote: > Paul Eggert writes: > >> If we want to do this sort of thing, I suggest using a different >> name for the static analysis macro, a name that more >> obviously differs from "assert (X)". How about "assume (X)"? > > invariant (X)? I like that. Though we should probably name it

Re: getloadavg and errno

2011-02-15 Thread Paul Eggert
On 02/15/2011 03:25 AM, Jim Meyering wrote: Specifying that errno may be changed sounds better, even though coreutils' sole use in uptime.c does not use that. I think I'd prefer a getloadavg that always sets errno when it fails; that's simpler and regular, and it's what getloadavg does on GNU/L

Re: [PATCH] vasnprintf: silence some clang false positives

2011-02-15 Thread Paul Eggert
invariant (X)? I'm not a big fan of that name, since the expressions in question are often not invariants. They might be preconditions or postconditions, for example.

[PATCH] getloadavg: omit unused var

2011-02-15 Thread Paul Eggert
This fixes a glitch I introduced a few days ago. * lib/getloadavg.c (getloadavg): Omit unused local variable. --- ChangeLog|5 + lib/getloadavg.c |1 - 2 files changed, 5 insertions(+), 1 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8e14a2b..3e0378c 100644 --- a/Cha

Re: [PATCH] vasnprintf: silence some clang false positives

2011-02-15 Thread Jim Meyering
Paul Eggert wrote: >>> invariant (X)? > > I'm not a big fan of that name, since the expressions in > question are often not invariants. They might be preconditions > or postconditions, for example. True. So gl_assume (X) ? Hmm... or gl_veritas (X) But that's probably too obscure. Which makes m

Re: getloadavg test

2011-02-15 Thread Paul Eggert
Thanks for that review, Bruno. I'll add the following before pushing: From c46ceeaabfab5055455daf282e64bc37d3a98ea9 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 15 Feb 2011 13:09:20 -0800 Subject: [PATCH] test-getloadavg: make it act like other tests Suggested by Bruno Haible in

static analysis assumption (was: Re: [PATCH] vasnprintf: silence some clang false positives)

2011-02-15 Thread Bruce Korb
On 02/15/11 12:38, Paul Eggert wrote: >>> invariant (X)? gl_assume(X) seems like a good choice to me. "invariant" doesn't imply that "X" is either true or false and, as Paul said, the expression need not be constructed of invariant components. Yes, the result should be invariant (invariant-true