if(...);
?#include <stdio.h>
int main(int argc, char **argv) {
if(argc < 2);
{
fprintf(stderr, "Usage: program PARAM\n");
return 1;
}
return 0;
}
$ gcc -Wall -Wextra a.c
a.c: In function βmainβ:
a.c:4:14: warning: suggest braces around empty body in an βifβ statement [-Wempty-body]
4 | if(argc < 2);
| ^
a.c:4:2: warning: this βifβ clause does not guard... [-Wmisleading-indentation]
4 | if(argc < 2);
| ^~
a.c:5:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the βifβ
5 | {
| ^
a.c:3:27: warning: unused parameter βargvβ [-Wunused-parameter]
3 | int main(int argc, char **argv) {
| ~~~~~~~^~~~
$ clang -Wall -Wextra a.c
a.c:4:14: warning: if statement has empty body [-Wempty-body]
if(argc < 2);
^
a.c:4:14: note: put the semicolon on a separate line to silence this warning
a.c:3:27: warning: unused parameter 'argv' [-Wunused-parameter]
int main(int argc, char **argv) {
^
2 warnings generated.
MAX_CLIENTS=64,
MAX_PLAYERS=16,
if abs(force) >= 5:
do_stuff()
why does it not work? Oh right