xiaoxiang781216 commented on code in PR #12638: URL: https://github.com/apache/nuttx/pull/12638#discussion_r1667592912
########## Documentation/introduction/rules_check.rst: ########## @@ -0,0 +1,54 @@ +============ +Rules Checks +============ + +.. note:: this should be revised + +NuttX uses Kconfig and its main checking for rules and dependencies between +features to guarantee that the system will compile correctly. + +Another resource used to enforce that none pre-required feature was left behind +is the "#ifdef" inside the source code. Although effective to detect configuration +issue, this technic should be avoid in favor of more well though rules inside +Kconfig. + +However, it is not possible to enforce many rules inside the Kconfig, otherwise +the configuration becomes very inflexible and will not allow some use cases. + +For those case where Kconfig rule cannot fix everything, we need to return to +#ifdef approach inside the code. But there is an issue: imagine we put a rule +inside the file_feature_A.c: + +.. code-block:: c + + #if !defined(CONFIG_FEATURE_B) Review Comment: the correct approach is adding `depend on` or `select` to express the relationship in Kconfig to avoid the error happen directly. -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
