C standard forbids it - when compiled with gcc -pedantic
, it produces invalid application of ‘sizeof’ to a function type
warning.
However gcc
compiles it and returns 1
for sizeof(main)
, and it is not a size of function pointer.
It seems to be compiler-dependent.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…