warning: return type defaults to ‘int’ [-Wreturn-type]

main()

should be

int main()

In C89, the default return type is assumed to be int, that’s why it works.

Leave a Comment