1st case:
#include <stdio.h>
int main(void)
{
return 0;
}
Output Size:
text data bss dec hex filename
1115 552 8 1675 68b ./a.out
Second case:
#include <stdio.h>
int global;
int main(void)
{
return 0;
}
the size:
text data bss dec hex filename
1115 552 8 1675 68b ./a.out
Ideally, this should be:
bss=12 and all other (text and data) same
The third case:
#include <stdio.h>
int global;
int main(void)
{
static int i;
return 0;
}
the size:
text data bss dec hex filename
1115 552 16 1683 693 ./a.out
it is right
Why is the conclusion in the second case incorrect?
source
share