SolidWallOfCode commented on a change in pull request #7829:
URL: https://github.com/apache/trafficserver/pull/7829#discussion_r631528935



##########
File path: include/ts/apidefs.h.in
##########
@@ -51,11 +51,65 @@
 #define tsapi
 #endif
 
+/** Apply printf format string compile-time argument checking to a function.
+ *
+ *
+ * For example, given the following function from DiagsTypes.h:
+ *
+ * @code
+ * class Diags {
+ *
+ * ...
+ *
+ * void
+ * print(
+ *     const char *tag,
+ *     DiagsLevel level,
+ *     const SourceLocation *loc,
+ *     const char *fmt,
+ *     ...) const;
+ *
+ * ...
+ *
+ * };
+ * @endcode
+ *
+ * This macro can be used to apply compiler checking for ... against the fmt
+ * argument like so:
+ *
+ *
+ * @code
+ * class Diags {
+ *
+ * ...
+ *
+ * void
+ * print(
+ *     const char *tag,
+ *     DiagsLevel level,
+ *     const SourceLocation *loc,
+ *     const char *fmt,
+ *     ...) const TS_PRINTFLIKE(5, 6);
+ *
+ * ...
+ *
+ * };
+ * @endcode
+ *
+ * Note in this case, (5, 6) rather than (4, 5) is passed because `this`
+ * counts as the implicit first parameter of this member function.
+ *
+ * @fmt_index The index of the format string argument, with argument indexing

Review comment:
       Missed this previously - should be
   ```
   @param fmt_index The index ....
   @param arg_idx The index ....
   ```
   
[Example](https://github.com/apache/trafficserver/blob/master/include/ts/ts.h#L213).
   
   Doxygen formatting is always "@cmd arg" where "cmd" is a Doxygen. For 
instance, to refer to the parameter "fmt_index"  you would use `@a fmt_index`. 
So "@fmt_indx" isn't write.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to