On Thu, May 7, 2020 at 1:48 AM Xiang Xiao <xiaoxiang781...@gmail.com> wrote: > > Yes, I remove #if/#endif intentionally because it doesn't make sense that > user disable all three method which provide the critical memory info to OS. > > -----Original Message----- > From: Abdelatif Guettouche <abdelatif.guettou...@gmail.com> > Sent: Thursday, May 7, 2020 1:18 PM > To: dev@nuttx.apache.org > Subject: Re: New unused variables warning in nx_start() > > Removing this [1] ifdefs introduced the warning in a flat build. > > 1. > https://github.com/apache/incubator-nuttx/commit/eca70597858bc619d3114901d16e4a30f1ebffbe#diff-e36621b38d26a5eeb9f0c9c779931e7bL548
I don't understand. I am doing a FLAT build. There are three conditional blocks that could use the heap_start and heap_size variables. Two of them, CONFIG_MM_KERNEL_HEAP and/or CONFIG_MM_PGALLOC are applicable only to PROTECTED or KERNEL builds. The other one, MM_KERNEL_USRHEAP_INIT is decided by preprocessor logic in include/nuttx/mm.h: #undef MM_KERNEL_USRHEAP_INIT #if !defined(CONFIG_BUILD_KERNEL) && defined(__KERNEL__) # define MM_KERNEL_USRHEAP_INIT 1 #endif This is the only place it is defined. But I don't understand this logic: When does !defined(CONFIG_BUILD_KERNEL) && defined(__KERNEL__) happen? Nathan