Why does the statement "2i;" NOT cause a compiler error?
<p>Instead of <code>2*i</code>, I carelessly wrote <code>2i</code>:</p>

<pre><code>int foo(int i)
{
    2i;
    return 2i;
}
</code></pre>

<p>I expected the compiler to catch the error. But it did not. So is <code>2i</code> a valid statement in C? If so what does it do? Puzzled!</p>

<p>I compiled using gcc version 5.3.0 and here is the assembly output:</p>

<pre><code>    .file   "strange.c"
    .text
    .globl  foo
    .type   foo, @function
foo:
.LFB0:
    .cfi_startproc
    pushq   %rbp
    .cfi_def_cfa_offset 16
    .cfi_offset 6, -16
    movq    %rsp, %rbp
    .cfi_def_cfa_register 6
    movl    %edi, -4(%rbp)
    nop
    popq    %rbp
    .cfi_def_cfa 7, 8
    ret
    .cfi_endproc
.LFE0:
    .size   foo, .-foo
    .ident  "GCC: (GNU) 5.3.0"
    .section    .note.GNU-stack,"",@progbits
</code></pre>