int main()
{
       int var;
       char string[50];
       
       (var, string);
       (0);
       (0, 1, 2);
 
       return 0;
}

Reply ASAP
Thanks in advance
Govinda Attal.

This code does compile and generates an exe file...When I went thru disassembly, I found nothing useful in it...There were no nops in it. First of all our basic coding principles say that it should give a compiler error... compilers like msvc, gcc simply pass without giving any error or warnings..

This code does compile and generates an exe file...When I went thru disassembly, I found nothing useful in it...There were no nops in it. First of all our basic coding principles say that it should give a compiler error... compilers like msvc, gcc simply pass without giving any error or warnings..

I compiled to assembly and peeked at it too. The compiler just optimizes the NOPs out, so you pretty much get stack allocation and stack deallocation and that's it.

This code does compile and generates an exe file...When I went thru disassembly, I found nothing useful in it...There were no nops in it. First of all our basic coding principles say that it should give a compiler error... compilers like msvc, gcc simply pass without giving any error or warnings..

<gcc simply pass without giving errors or warnings
Well there are warnings. Try to copile like this gcc var.c -o var -Wall <When I went thru disassembly, I found nothing useful in it
ofcourse that's exactly what warnings try to tell

var.c: In function `main':
var.c:6: warning: left-hand operand of comma expression has no effect
var.c:8: warning: left-hand operand of comma expression has no effect
var.c:8: warning: left-hand operand of comma expression has no effect
var.c:6: warning: statement with no effect
var.c:7: warning: statement with no effect
var.c:8: warning: statement with no effect
This article has been dead for over six months. Start a new discussion instead.