I have a very simple c program as below. When I run organize includes on the code it removes all the unwanted include files and forward declares functions. But sometimes this declaration is not correct. For example in the case of printf(), it accepts variable arguments but cdt forward declare the function with only one argument which is incorrect. I think the organize include feature is not working properly, can anyone help me to make it work correctly.
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void) {
int a;
char src[50], dest[50];
strcpy(src, "This is test");
strcpy(dest, "This is test2");
strcat(src, dest);
puts("!!!Hello World!!!");
a = 5;
printf("%d\n", a);
return 0;
}
and i get the following output after running organize includes:
int printf(const char *); // <------ wrong forward declaration?
int puts(const char *);
char * strcat(char *, const char *);
char * strcpy(char *, const char *);
int main(void) {
int a;
char src[50], dest[50];
strcpy(src, "This is test");
strcpy(dest, "This is test2");
strcat(src, dest);
puts("!!!Hello World!!!");
a = 5;
printf("%d\n", a);
return 0;
}