Pelles C forum

Pelles C => General discussions => Topic started by: Alessio on August 09, 2005, 05:42:44 PM

Title: Compiler level 2 warnings
Post by: Alessio 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.
Title: Compiler level 2 warnings
Post by: Pelle 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