patacongo commented on a change in pull request #3657:
URL: https://github.com/apache/incubator-nuttx/pull/3657#discussion_r626016997
##########
File path: arch/risc-v/src/esp32c3/hardware/esp32c3_gpio.h
##########
@@ -25,7 +25,7 @@
* Included Files
****************************************************************************/
-#include "hardware/esp32c3_soc.h"
+#include "esp32c3_soc.h"
Review comment:
Careful. In some cases, there is are header files of the same name at
arch/xxx/src/xxx and at arch/xxx/src/xxx/hardware/. In that case, the
hardware/ prefix can be required if your include patch has ".",
arch/xxx/src/chip and arch/xxx/src/xxx/hardware on it. In that case, the order
will depend on the context and the order of the include paths on on the command
line.
This sometimes catches you if "." is not where you think it might be. I
have had to add the hardware/ prefix to other architectures in the past to
avoid including the wrong file. Also, I suspect that there might be issues in
certain cases if arch/xxx/src/xxx/hardware/header.h includes
arch/xxx/src/chip/header.h. I have experienced that even though
arch/xxx/src/chip appeared on the include search path first. I never really
understood, but adding hardware/ eliminated the bad inclusion.
A safer solution would be to remove arch/xxx/src/xxx/hardware from the
include search path and always preface the inclusion with hardware/.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]