07-24-2023, 12:48 AM
#include <stdio.h>
volatile int i;
int main()
{
int c;
for (i = 0; i < 3; i++)
{
c = i &&& i;
printf("%d\n", c);
}
return 0;
}
The output of the above program compiled using `gcc` is
0
1
1
With the `-Wall` or `-Waddress` option, `gcc` issues a warning:
warning: the address of ‘i’ will always evaluate as ‘true’ [-Waddress]
How is `c` being evaluated in the above program?
volatile int i;
int main()
{
int c;
for (i = 0; i < 3; i++)
{
c = i &&& i;
printf("%d\n", c);
}
return 0;
}
The output of the above program compiled using `gcc` is
0
1
1
With the `-Wall` or `-Waddress` option, `gcc` issues a warning:
warning: the address of ‘i’ will always evaluate as ‘true’ [-Waddress]
How is `c` being evaluated in the above program?