Build - check for '-Wredundant-decls' and fix all the warnings reported by gcc

Signed-off-by: Davide Madrisan <davide.madrisan@gmail.com>