NO

Author Topic: Compiler level 2 warnings  (Read 3507 times)

Alessio

  • Guest
Compiler level 2 warnings
« on: August 09, 2005, 05:42:44 PM »
Hi, I was wonder why this code

Code: [Select]
#include <stdio.h>

int main(void) {

int i;

i , 2;

return 0;
}


do not generate a warning until I set compiler level warnings to 2.
I'm just damn curious!
I've spent a day to found a bug in my code...from now I'll set compiler level warnings to 2 on every project.

Thank you.

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Compiler level 2 warnings
« Reply #1 on: August 09, 2005, 06:08:51 PM »
It's an example of the comma operator, which is perfectly valid. Maybe "Expression with no effect removed" should be at level 1, but I'm not completely sure it's a good thing.

Pelle
/Pelle