Code:
#define L_VARIABLE 0xFF
#define N_VARIABLE 173
char sDS_PKG_VariableName[N_VARIABLE][L_VARIABLE]={"ANT_PC_GPS","AS2DEG","BOLTZ","CHANNEL_ID","CLK_ERR_GPS_SAT","CLOCK_BIAS","COARSE_OBT0","COARSE_UTC0","COR_SPAC","CPM_CORR_L1","CPM_CORR_L2","CPM_L1","CPM_L2","C_A_PRM_CORR_SM","C_A_PRM_L1","C_L","C_PN","ClockOffset","ClockTimetag","DATA_THRES",/* 173 variables name I'm obviously not pasting them all... */
}
qsort(sDS_PKG_VariableName,N_VARIABLE,L_VARIABLE,strcmp);
if(bsearch("C_L",sDS_PKG_VariableName,N_VARIABLE,L_VARIABLE,strcmp)==NULL) {
/* blabla */
} else {
/* blabla */
}
ok nothing really special about it.
However when I compile with gcc it gives me those warnings:
warning: passing arg 4 of 'qsort' for incompatible pointer type
warning: passing arg 5 of 'bsearch' for incompatible pointer type
At the end of the day it works fine.
But I am wondering why do I get warnings like that because it is really "by-the-book" example of use qsort and bsearch.
Cheers