Add some GCC5 warning flags
Trailing ,
Add BSD header checks from sort_r
Use __FUNCTION__ (c99) replacing __func__ (c90)