DOC: C docstrings are outdated/malformed (`-Wdocumentation`)
Author: e-kwsmCreated Sep 11, 2024Updated Sep 30, 2026
Labels04 - Documentationsustain-2026
Issue with current documentation:
- numpy: 129c6e57052eb243241b5d2d8b7ccb8a8bb3d9ae
- clang: version 18.1.8
$ CC=clang CXX=clang++ CFLAGS=-Wdocumentation pip install --log PIP.log .
$ grep -- -Wdocumentation PIP.log | sed -E -e 's/^\S+\s+//' | sort -n | uniq
../numpy/_core/include/numpy/dtype_api.h:271:11: warning: parameter 'nargs' not found in the function declaration [-Wdocumentation]
../numpy/_core/src/common/npy_argparse.c:283:18: warning: empty paragraph passed to '@param' command [-Wdocumentation]
../numpy/_core/src/common/npy_argparse.c:284:15: warning: empty paragraph passed to '@param' command [-Wdocumentation]
../numpy/_core/src/common/npy_argparse.c:286:18: warning: empty paragraph passed to '@param' command [-Wdocumentation]
../numpy/_core/src/common/npy_argparse.c:287:17: warning: empty paragraph passed to '@param' command [-Wdocumentation]
../numpy/_core/src/common/npy_argparse.h:72:18: warning: empty paragraph passed to '@param' command [-Wdocumentation]
../numpy/_core/src/common/npy_import.h:84:11: warning: parameter 'cache' not found in the function declaration [-Wdocumentation]
../numpy/_core/src/multiarray/array_coercion.c:663:17: warning: empty paragraph passed to '@param' command [-Wdocumentation]
../numpy/_core/src/multiarray/array_coercion.c:908:13: warning: empty paragraph passed to '@param' command [-Wdocumentation]
../numpy/_core/src/multiarray/array_method.c:126:17: warning: empty paragraph passed to '@param' command [-Wdocumentation]
../numpy/_core/src/multiarray/array_method.c:127:17: warning: empty paragraph passed to '@param' command [-Wdocumentation]
../numpy/_core/src/multiarray/array_method.c:128:11: warning: parameter 'move_references' not found in the function declaration [-Wdocumentation]
../numpy/_core/src/multiarray/array_method.c:129:17: warning: empty paragraph passed to '@param' command [-Wdocumentation]
../numpy/_core/src/multiarray/array_method.c:130:11: warning: parameter 'descriptors' not found in the function declaration [-Wdocumentation]
../numpy/_core/src/multiarray/array_method.c:130:21: warning: empty paragraph passed to '@param' command [-Wdocumentation]
../numpy/_core/src/multiarray/array_method.c:131:18: warning: empty paragraph passed to '@param' command [-Wdocumentation]
../numpy/_core/src/multiarray/array_method.c:132:26: warning: empty paragraph passed to '@param' command [-Wdocumentation]
../numpy/_core/src/multiarray/array_method.c:133:15: warning: empty paragraph passed to '@param' command [-Wdocumentation]
../numpy/_core/src/multiarray/array_method.c:172:14: warning: empty paragraph passed to '@param' command [-Wdocumentation]
../numpy/_core/src/multiarray/common.c:191:11: warning: parameter 'Dimensionality' not found in the function declaration [-Wdocumentation]
../numpy/_core/src/multiarray/common.c:192:11: warning: parameter 'npy_intp' not found in the function declaration [-Wdocumentation]
../numpy/_core/src/multiarray/common.c:193:11: warning: parameter 'String' not found in the function declaration [-Wdocumentation]
../numpy/_core/src/multiarray/common.c:302:11: warning: parameter '"value"' not found in the function declaration [-Wdocumentation]
../numpy/_core/src/multiarray/common.h:75:11: warning: parameter '"value"' not found in the function declaration [-Wdocumentation]
../numpy/_core/src/multiarray/common_dtype.c:109:16: warning: empty paragraph passed to '@param' command [-Wdocumentation]
../numpy/_core/src/multiarray/conversion_utils.c:1126:12: warning: parameter 'max_vals' not found in the function declaration [-Wdocumentation]
../numpy/_core/src/multiarray/convert_datatype.c:1665:11: warning: parameter 'ndescrs' not found in the function declaration [-Wdocumentation]
../numpy/_core/src/multiarray/convert_datatype.c:170:15: warning: empty paragraph passed to '@param' command [-Wdocumentation]
../numpy/_core/src/multiarray/convert_datatype.c:171:13: warning: empty paragraph passed to '@param' command [-Wdocumentation]
../numpy/_core/src/multiarray/convert_datatype.c:1970:14: warning: empty paragraph passed to '@param' command [-Wdocumentation]
../numpy/_core/src/multiarray/convert_datatype.c:2022:14: warning: empty paragraph passed to '@param' command [-Wdocumentation]
../numpy/_core/src/multiarray/convert_datatype.c:222:18: warning: empty paragraph passed to '@param' command [-Wdocumentation]
../numpy/_core/src/multiarray/convert_datatype.c:223:18: warning: empty paragraph passed to '@param' command [-Wdocumentation]
../numpy/_core/src/multiarray/convert_datatype.c:412:14: warning: empty paragraph passed to '@param' command [-Wdocumentation]
../numpy/_core/src/multiarray/convert_datatype.c:416:26: warning: empty paragraph passed to '@param' command [-Wdocumentation]
../numpy/_core/src/multiarray/convert_datatype.c:461:14: warning: empty paragraph passed to '@param' command [-Wdocumentation]
../numpy/_core/src/multiarray/convert_datatype.c:68:15: warning: empty paragraph passed to '@param' command [-Wdocumentation]
../numpy/_core/src/multiarray/convert_datatype.c:69:13: warning: empty paragraph passed to '@param' command [-Wdocumentation]
../numpy/_core/src/multiarray/convert_datatype.c:796:19: warning: empty paragraph passed to '@param' command [-Wdocumentation]
../numpy/_core/src/multiarray/convert_datatype.c:797:19: warning: empty paragraph passed to '@param' command [-Wdocumentation]
../numpy/_core/src/multiarray/convert_datatype.c:798:17: warning: empty paragraph passed to '@param' command [-Wdocumentation]
../numpy/_core/src/multiarray/ctors.c:1419:11: warning: parameter 'requested_type' not found in the function declaration [-Wdocumentation]
../numpy/_core/src/multiarray/descriptor.c:1412:15: warning: empty paragraph passed to '@param' command [-Wdocumentation]
../numpy/_core/src/multiarray/descriptor.c:1444:15: warning: empty paragraph passed to '@param' command [-Wdocumentation]
../numpy/_core/src/multiarray/descriptor.c:1445:19: warning: empty paragraph passed to '@param' command [-Wdocumentation]
../numpy/_core/src/multiarray/descriptor.c:1446:19: warning: empty paragraph passed to '@param' command [-Wdocumentation]
../numpy/_core/src/multiarray/descriptor.c:1473:16: warning: parameter 'npy_dtype_info' not found in the function declaration [-Wdocumentation]
../numpy/_core/src/multiarray/descriptor.c:1525:16: warning: parameter 'npy_dtype_info' not found in the function declaration [-Wdocumentation]
../numpy/_core/src/multiarray/dtypemeta.c:377:11: warning: parameter 'self' not found in the function declaration [-Wdocumentation]
../numpy/_core/src/multiarray/dtypemeta.c:377:14: warning: empty paragraph passed to '@param' command [-Wdocumentation]
../numpy/_core/src/multiarray/mapping.c:2415:11: warning: parameter 'MapIterObject' not found in the function declaration [-Wdocumentation]
../numpy/_core/src/multiarray/mapping.c:2415:23: warning: empty paragraph passed to '@param' command [-Wdocumentation]
../numpy/_core/src/multiarray/mapping.c:2416:11: warning: parameter 'The' not found in the function declaration [-Wdocumentation]
../numpy/_core/src/multiarray/mapping.c:2417:11: warning: parameter 'Number' not found in the function declaration [-Wdocumentation]
../numpy/_core/src/multiarray/mapping.c:2418:11: warning: parameter 'The' not found in the function declaration [-Wdocumentation]
../numpy/_core/src/multiarray/mapping.c:266:11: warning: parameter 'the' not found in the function declaration [-Wdocumentation]
../numpy/_core/src/multiarray/mapping.c:267:11: warning: parameter 'the' not found in the function declaration [-Wdocumentation]
../numpy/_core/src/multiarray/mapping.c:269:11: warning: parameter 'number' not found in the function declaration [-Wdocumentation]
../numpy/_core/src/multiarray/mapping.c:270:11: warning: parameter 'dimension' not found in the function declaration [-Wdocumentation]
../numpy/_core/src/multiarray/mapping.c:271:11: warning: parameter 'dimension' not found in the function declaration [-Wdocumentation]
../numpy/_core/src/multiarray/mapping.c:272:11: warning: parameter 'whether' not found in the function declaration [-Wdocumentation]
../numpy/_core/src/multiarray/mapping.c:785:11: warning: parameter 'Array' not found in the function declaration [-Wdocumentation]
../numpy/_core/src/multiarray/mapping.c:786:11: warning: parameter 'result' not found in the function declaration [-Wdocumentation]
../numpy/_core/src/multiarray/mapping.c:787:11: warning: parameter 'parsed' not found in the function declaration [-Wdocumentation]
../numpy/_core/src/multiarray/mapping.c:788:11: warning: parameter 'number' not found in the function declaration [-Wdocumentation]
../numpy/_core/src/multiarray/mapping.c:817:11: warning: parameter 'Array' not found in the function declaration [-Wdocumentation]
../numpy/_core/src/multiarray/mapping.c:818:11: warning: parameter 'resulting' not found in the function declaration [-Wdocumentation]
../numpy/_core/src/multiarray/mapping.c:819:11: warning: parameter 'parsed' not found in the function declaration [-Wdocumentation]
../numpy/_core/src/multiarray/mapping.c:820:11: warning: parameter 'number' not found in the function declaration [-Wdocumentation]
../numpy/_core/src/multiarray/mapping.c:821:11: warning: parameter 'Whether' not found in the function declaration [-Wdocumentation]
../numpy/_core/src/multiarray/textreading/rows.c:160:11: warning: parameter 'num_cols' not found in the function declaration [-Wdocumentation]
../numpy/_core/src/multiarray/usertypes.c:621:14: warning: empty paragraph passed to '@param' command [-Wdocumentation]
../numpy/_core/src/multiarray/usertypes.c:622:12: warning: empty paragraph passed to '@param' command [-Wdocumentation]
../numpy/_core/src/umath/dispatching.c:216:15: warning: empty paragraph passed to '@param' command [-Wdocumentation]
../numpy/_core/src/umath/ufunc_object.c:4196:15: warning: empty paragraph passed to '@param' command [-Wdocumentation]e.g.
here parameter names are missing:
--- a/numpy/_core/src/multiarray/common.c
+++ b/numpy/_core/src/multiarray/common.c
@@ -188,9 +188,9 @@ _IsWriteable(PyArrayObject *ap)
/**
* Convert an array shape to a string such as "(1, 2)".
*
- * @param Dimensionality of the shape
- * @param npy_intp pointer to shape array
- * @param String to append after the shape `(1, 2)%s`.
+ * @param n Dimensionality of the shape
+ * @param vals npy_intp pointer to shape array
+ * @param ending String to append after the shape `(1, 2)%s`.
*
* @return Python unicode string
*/here nargs seems to have been split into nin and nout.
Idea or request for content:
Fix the C docstrings.
Source: numpy/numpy