acassis commented on code in PR #12638:
URL: https://github.com/apache/nuttx/pull/12638#discussion_r1667671527


##########
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:
   Hi Xiang, exactly but the idea it to find and report warning for "probably 
desire of use". Imagine someone enabled NET and IPv4, it is probable that 
he/she wants to use ICMP but we cannot enforce it because we don't know what 
his/her use case. So we could add some checking in the code to print #error or 
#warn to let the user aware. It is already used in the NuttX in many places



-- 
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]

Reply via email to