最初のケース:
#include <stdio.h>
int main(void)
{
return 0;
}
サイズ出力:
text data bss dec hex filename
1115 552 8 1675 68b ./a.out
2番目のケース:
#include <stdio.h>
int global; // new line compared to previous case
int main(void)
{
return 0;
}
サイズ出力:
text data bss dec hex filename
1115 552 8 1675 68b ./a.out
理想的には、次のようにする必要があります。
bss=12 and all other (text and data) same
3番目のケース:
#include <stdio.h>
int global;
int main(void)
{
static int i; // new line compared to previous case
return 0;
}
サイズ出力:
text data bss dec hex filename
1115 552 16 1683 693 ./a.out
正解です
2 番目のケースの出力が正しくないのはなぜですか?