[U-Boot] __FILE__ usage and and SPL limits for SRAM

Nishanth Menon nm at ti.com
Tue Mar 28 11:59:08 UTC 2017


On Tue, Mar 28, 2017 at 6:47 AM, Felipe Balbi
<felipe.balbi at linux.intel.com> wrote:
>
> have you tried using __BASE_FILE__ instead of __FILE__? You could also

https://gcc.gnu.org/onlinedocs/gcc-4.1.2/cpp/Common-Predefined-Macros.html
__BASE_FILE__This macro expands to the name of the main input file, in
the form of a C string constant. This is the source file that was
specified on the command line of the preprocessor or C compiler.

__FILE__ and __BASE_FILE__ are'nt the same. and further, __FILE__ is
used in many places in source unfortunately.

> redefine __FILE__ or __BASE_FILE__ while building SPL.

As I mentioned in my original email:

a) override __FILE__ with something.. -Wbuiltin-macro-redefined kicks in

If we decide to deprecate usage of __FILE__ , it wont be intutive, the
option i can think of is to override __FILE__ and somehow just squash
warning just for __FILE__ (I have'nt investigated how).. and get a
build time macro to  define relative path which is provided as a
replacement for __FILE__

[1] http://stackoverflow.com/questions/8487986/file-macro-shows-full-path

-- 
---
Regards,
Nishanth Menon


More information about the U-Boot mailing list