avoid warning message for defined but unused variables
use stable_sort instead of GNU library specific function
remove unnecessary typedef