2

Recently I am reading linux kernel code and I read this:

#define MODULE_PARM_DESC(_parm, desc) \
    __MODULE_INFO(parm, _parm, #_parm ":" desc)

I am very confused that why there is a "parm", what is the relationship between "parm" and "_parm"?

4va1anch3
  • 427
  • 1
  • 4
  • 13
  • 1
    I think that underscore is just part of a naming convention. – Tim Biegeleisen Oct 18 '17 at 03:01
  • 1
    C treats `_` as an alphabetic character, just like `a` or `x` for example. Anything else is strictly a naming convention. – Tom Karzes Oct 18 '17 at 03:03
  • 1
    `_` is like a letter yet may also begin various reserve identifiers. – chux - Reinstate Monica Oct 18 '17 at 03:17
  • 2
    Apart from the fact that some identifiers starting with `_` are reserved in certain contexts, `parm` and `_parm` are entirely distinct identifiers. There is no more relationship between them than between `parm` and `foo`, or between `parm` and `Parm`. (Obviously the author of the code meant them to appear similar.) – Keith Thompson Oct 18 '17 at 03:27

0 Answers0