Re: const local variables

2010-04-12 Thread Ludovic Courtès
Hello, Paul Eggert writes: > All other things being equal, we should be encouraging a functional > style in which most local variables and parameters are never modified > once set. Agreed. How about adding something along these lines in the GCS? Thanks, Ludo’.

Re: const local variables

2010-04-11 Thread Paul Eggert
I agree with Bruno on this point. It's hard enough to read C code without having to wade through all those 'const's on local variables. The tiny extra benefit that they provide is not worth the overhead on people trying to read the code. What's next? Should we also add 'const' to parameter decla

Re: const local variables

2010-04-11 Thread Jim Meyering
James Youngman wrote: > On Sun, Apr 11, 2010 at 1:08 PM, Bruno Haible wrote: >> James Youngman wrote: >>> * lib/close-stream.c (close_stream): Make boolean variables const >>> to document the fact that we set but do not change them. >>> --- a/lib/close-stream.c >>> +++ b/lib/close-stream.c >>> @@

Re: const local variables

2010-04-11 Thread James Youngman
On Sun, Apr 11, 2010 at 1:08 PM, Bruno Haible wrote: > James Youngman wrote: >> * lib/close-stream.c (close_stream): Make boolean variables const >> to document the fact that we set but do not change them. >> --- a/lib/close-stream.c >> +++ b/lib/close-stream.c >> @@ -55,9 +55,9 @@ >>  int >>  clo

Re: const local variables

2010-04-11 Thread Bruno Haible
James Youngman wrote: > * lib/close-stream.c (close_stream): Make boolean variables const > to document the fact that we set but do not change them. > --- a/lib/close-stream.c > +++ b/lib/close-stream.c > @@ -55,9 +55,9 @@ > int > close_stream (FILE *stream) > { > - bool some_pending = (__fpend