Re: [RFC 0/2] Factor Kconfig's prefix and package name

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 
> > 3) Do not hardcode "CONFIG_"
> >  - I suggest to introduce a single define named "CONFIG_".
> >    All the places that hardcode the length should be
> >    replaced by strlen(CONFIG_).
> >  - The define should be conditional like this:
> > #if !defined(CONFIG_)
> > #define CONFIG_ "CONFIG_"
> > #endif
> >    In this way other users can just use -DCONFIG_=BR2_ as they prefer.
> >
> agreed. the only thing I am not really fond of is that "strlen(...)"
> is computed at runtime, whereas "sizeof(...)-1" is a build time
> constant, but this might not be that worth.

gcc will recognize that strlen("CONFIG_") is a constant
and will optimize out the call.

	Sam
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux