Search code examples
ccomments

What does at symbol (@) mean in comments for C?


I see that some programming languages use "@" in comments. For example, here is a random program in the Linux kernel: https://elixir.bootlin.com/linux/v5.10.11/source/fs/ext4/dir.c#L37

/**
 * is_dx_dir() - check if a directory is using htree indexing
 * @inode: directory inode
 *
 * ...
 */
static int is_dx_dir(struct inode *inode)
{

What does the @ mean in @inode? What is this convention of using the "@" symbol called? Is it documented somewhere on the Internet?


Solution

  • It seems that the "@" symbol is indeed for documentation purpose. In the example I gave, the Linux kernel is using Sphinx, and the convention is documented here:

    https://www.kernel.org/doc/html/v4.10/doc-guide/kernel-doc.html#writing-kernel-doc-comments