<<< Date Index >>>     <<< Thread Index >>>

Re: mutt: Improve const correctness



On Saturday, 06 August 2005 at 21:10, SF Markus Elfring wrote:
> > Now, can you please put the const in front of the type? Everyone else
> > here prefers that ordering.
> 
> Do you like the appended version better?

yes, I like it better.

> Are there any developers here who are used to the right-to-left reading 
> direction for function arguments/parameters?
> 
> 
> > Also, please only put const in front of pointers. const char c is a
> > little overzealous for a call-by-value language.
> 
> I would like to be precise as possible.

If you were to go down this road to the end, almost every parameter
would be marked const. It's very rare for mutt functions to write to
parameter variables, and furthermore harmless. Luckily there was only
one instance of this in your patch, which I assume was actually a
mistake.

Now that your patch is in a form where it can be tested, I've
discovered that it
a) breaks compilation in a number of places. If you touch code, make
   sure it compiles. You'll probably want to enable all the optional
   parts of mutt during configure.
b) generates a lot of "discards qualifiers from pointer target type"
   errors. This pretty much defeats the purpose of your const
   correctness patch. Make sure these are all cleared up in your next
   version.

thanks for your contribution.

-b

Attachment: pgpdgpmpghWTV.pgp
Description: PGP signature