Hi Prashant

On 11/24/26 8:33 AM, Prashant Chinnam wrote:
Hi Takeshi, Chao,

Thanks, Chao, for the review and your comment "LGTM on v5."

Takeshi, just a gentle ping: v5 has been out for about three
weeks, with CFBot green and Chao's LGTM on it. If you have any
further comments, I am happy to address them. If you are
satisfied with v5, would you be willing to mark it Ready for
Committer in the commitfest app?


Apologies I was away from this thread for long time. Thank you for the patch update. I checked v5 and code itself looks good to me. However, let me add some points for the code comments.

+/*
+ * Maximum length of the rounds value printed in the clamp NOTICEs of
+ * px_crypt_shacrypt().  The supplied token is echoed so that an
+ * out-of-range value is reported as given, but it comes from the
+ * caller-supplied salt string and can be arbitrarily long; cap the
+ * echo at one more than the number of digits of the maximum
+ * supported value, and mark where the value was truncated.
+ */
+#define PX_SHACRYPT_ROUNDS_PRINT_MAX \
+       ((int) sizeof(CppAsString2(PX_SHACRYPT_ROUNDS_MAX)))

The comment looks bit long to me. We can see what PX_SHACRYPT_ROUNDS_PRINT_MAX is from px_crypt_shacrypt(). How about shortening it to one or two lines, matching the style of the neighboring macros in px-crypt.h?

As per the wiki[1], I believe we can simplify the comment here:

>Comments are for clarification and to explain the why question, not for delineating your code from the surroundings nor to re-state what the code is doing. After your patch, the code should look as if it has always been written in that way, instead of the new feature having been bolted on after the fact.

[1] https://wiki.postgresql.org/wiki/Submitting_a_Patch

This also applies to test code comments. They could be shorter, just briefly stating what each rounds value is meant.

Regards,
Takeshi Ideriha


Reply via email to