fix compiler warnings and report warnings in log file
fix c linkage