>>>>> "Roland" == Roland Mainz <[EMAIL PROTECTED]> writes:

Ian> But it (140) is still a magic number, maybe make it a const size_t?

Roland> it may be a good idea to add a comment how the value "140" was
Roland> calculated.

There are (at least) 2 issues with magic numbers.

The first is understandability.  A comment that explains where the 140
comes from would fix that.

The second is robustness in the face of future changes.  For example, if
the 140 is derived from adding the lengths of other strings, then it
might make sense to arrange the code so that changing the strings (or
even adding a string) automatically changes the buffer size.  In this
particular case I'm not sure that's the right approach, but I think it
should be considered.  (I can't remember if Solaris prevents execution
out of the stack by default.  If it does, this is less of a concern.)

mike

_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to