Message ID | 1405027670-28516-1-git-send-email-jeroen@myspectrum.nl |
---|---|
State | Superseded |
Delegated to: | Tom Rini |
Headers | show |
Hi Jeroen, On 10-07-14 23:27, Jeroen Hofstee wrote: > --- > yup another clang warning: > > common/env_common.c:30:14: warning: unused function '__env_get_char_spec' [-Wunused-function] > static uchar __env_get_char_spec(int index) > ^ > --- > common/env_common.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/common/env_common.c b/common/env_common.c > index cd7b4cd..3b979bc 100644 > --- a/common/env_common.c > +++ b/common/env_common.c > @@ -27,12 +27,10 @@ struct hsearch_data env_htab = { > .change_ok = env_flags_validate, > }; > > -static uchar __env_get_char_spec(int index) > +__weak uchar env_get_char_spec(int index) > { > return *((uchar *)(gd->env_addr + index)); > } > -uchar env_get_char_spec(int) > - __attribute__((weak, alias("__env_get_char_spec"))); > > static uchar env_get_char_init(int index) > { signed-off is missing? Regards, Jeroen
Dear Jeroen, In message <1405027670-28516-1-git-send-email-jeroen@myspectrum.nl> you wrote: > > -static uchar __env_get_char_spec(int index) > +__weak uchar env_get_char_spec(int index) __weak static ... ? Best regards, Wolfgang Denk
Hello Wolfgang, On 11-07-14 06:26, Wolfgang Denk wrote: > Dear Jeroen, > > In message <1405027670-28516-1-git-send-email-jeroen@myspectrum.nl> you wrote: >> >> -static uchar __env_get_char_spec(int index) >> +__weak uchar env_get_char_spec(int index) > __weak static ... ? tempting huh, but it is the patch format with tricks you in thinking that. The weak is actually added to the function without the leading underscores, a couple of lines below (which wasn't static and shouldn't become so). Regards, Jeroen
Dear Jeroen Hofstee, In message <53C01BD7.8030608@myspectrum.nl> you wrote: > > >> -static uchar __env_get_char_spec(int index) > >> +__weak uchar env_get_char_spec(int index) > > __weak static ... ? > > tempting huh, but it is the patch format with tricks > you in thinking that. The weak is actually added to > the function without the leading underscores, a > couple of lines below (which wasn't static and > shouldn't become so). Argh. You are right. Best regards, Wolfgang Denk
diff --git a/common/env_common.c b/common/env_common.c index cd7b4cd..3b979bc 100644 --- a/common/env_common.c +++ b/common/env_common.c @@ -27,12 +27,10 @@ struct hsearch_data env_htab = { .change_ok = env_flags_validate, }; -static uchar __env_get_char_spec(int index) +__weak uchar env_get_char_spec(int index) { return *((uchar *)(gd->env_addr + index)); } -uchar env_get_char_spec(int) - __attribute__((weak, alias("__env_get_char_spec"))); static uchar env_get_char_init(int index) {