简体   繁体   中英

error on implicit declaration, but function is declared in source file

I am trying to build a wireless driver which is eventually failing on an implicit declaration error:

wl_iw.c: In function 'wl_iw_set_priv':
wl_iw.c:7649:4: error: implicit declaration of function 'wl_iw_set_cscan' [-Werror=implicit-function-declaration]

Here is where it tries to call the function:

#if defined(CSCAN)

    else if (strnicmp(extra, CSCAN_COMMAND, strlen(CSCAN_COMMAND)) == 0)
        ret = wl_iw_set_cscan(dev, info, (union iwreq_data *)dwrq, extra);
#endif 

So, it seems like this will only be called if CSCAN is defined. Well, in the source file, wl_iw_set_cscan is also declared if CSCAN is declared ( I believe ). Here is where it is defined (github) , and... if you scroll up a little bit, it only seems to be dependent on CSCAN being defined .

CSCAN is definitely defined, which is shown if I do a verbose build:

arm-linux-androideabi-gcc *snip* -DCSCAN *snip* -c -o /home/owner/android-wmon/core/compat-wireless-3.6-rc7-1/drivers/net/wireless/bcmdhd/wl_iw.o /home/owner/android-wmon/core/compat-wireless-3.6-rc7-1/drivers/net/wireless/bcmdhd/wl_iw.c

I can even be doubly sure by putting a "#define CSCAN" at the top of wl_iw.c and it will complain that it is defined twice. So I'm positive that CSCAN is defined.

If this is the case, why am I getting an implicit definition warning turned error? wl_iw_set_cscan should be defined since CSCAN is defined.

在第5781行,还有另一个#define正在屏蔽wl_iw_set_cscan

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM