The issue:
Your program is an executable file that you compiled. That means that it doesn't have any background. Your program will raise fewer flags if, for example, it had a verified publisher associated with it. See this post for some more detail on that. In addition, your app runs invisibly; that is, it does not allow user input. That is often a 'red flag' that will be detected by some antivirus programs.
Proof:
Your initial program looks like this when I compile it:
However, I altered the program like so:
#include <stdio.h>
char* func(char *str) {
return str;
}
void main() {
char str[] = "What the heck\n";
char *str2 = func(str);
printf(str2);
}
the program looks like this (the word was changed to heck and initialized differently):

Note that it looks exactly the same.
Now, when I alter the program like this:
#include <stdio.h>
//char* func(char *str) {
// return str;
//}
void main() {
char str[] = "What the heck\n";
//char *str2 = func(str);
//printf(str2);
}
the results look like this:
