this maybe is a special case. When i tracing a C code i saw warning . said
implicit declaration of function 'Wifi_Hosts_Sync_Func' [-Wimplicit-function-declaration]
i tried to eliminate it by using extern the function void *Wifi_Hosts_Sync_Func
but if i do this compiler shows Error : Wifi_Hosts_Sync_Func too few arguments.
my question is WHY this code can works?! & WHY program didn't crash or flash out on "run time". defined function need 5 argument ,calling code only gives 4 . this program can run normally and succeed end. any ideas?
// warning msg. ../../../../git/source/TR-181/ml/cosa_wifi_dml.c: In function 'WiFi_HostSyncThread': ../../../../git/source/TR-181/ml/cosa_wifi_dml.c:756:2: warning: implicit declaration of function 'Wifi_Hosts_Sync_Func' [-Wimplicit-function-declaration] Wifi_Hosts_Sync_Func(NULL,0, NULL, 1); ^~~~~~~~~~~~~~~~~~~~
in cosa_wifi_dml.c
void *WiFi_HostSyncThread()
{
fprintf(stderr,"[TRACE] before Wifi_Hosts_Sync_Func()");
Wifi_Hosts_Sync_Func(NULL,0, NULL, 1);
fprintf(stderr,"[TRACE] after Wifi_Hosts_Sync_Func()");
}
in cosa_wifi_apis.c
void *Wifi_Hosts_Sync_Func(void *pt, int index, wifi_associated_dev_t *associated_dev, BOOL bCallForFullSync, BOOL bCallFromDisConnCB )
{
fprintf(stderr,"[TRACE] Wifi_Hosts_Sync_Func() Call in.\n");
...
...
}