⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wparentheses-5.c

📁 用于进行gcc测试
💻 C
字号:
/* Test operation of -Wparentheses.  Precedence warnings.  && inside   ||.  *//* Origin: Joseph Myers <jsm@polyomino.org.uk> *//* { dg-do compile } *//* { dg-options "-Wparentheses" } */int foo (int);intbar (int a, int b, int c){  foo (a && b || c); /* { dg-warning "parentheses" "correct warning" } */  foo ((a && b) || c);  foo (a && (b || c));  foo (1 && 2 || c); /* { dg-warning "parentheses" "correct warning" } */  foo ((1 && 2) || c);  foo (1 && (2 || c));  foo (1 && 2 || 3); /* { dg-warning "parentheses" "correct warning" } */  foo ((1 && 2) || 3);  foo (1 && (2 || 3));  foo (a || b && c); /* { dg-warning "parentheses" "correct warning" } */  foo ((a || b) && c);  foo (a || (b && c));  foo (1 || 2 && c); /* { dg-warning "parentheses" "correct warning" } */  foo ((1 || 2) && c);  foo (1 || (2 && c));  foo (1 || 2 && 3); /* { dg-warning "parentheses" "correct warning" } */  foo ((1 || 2) && 3);  foo (1 || (2 && 3));}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -