*min*and

*max*operators:

Code: Select all

```
max Least representable value in the reduction list item type
min Largest representable value in the reduction list item type
```

*_Bool*data type (and C++

*bool*, for that matter)? The final C11 draft (N1570) states the following on p. 51:

Based on this, I think it would be least surprising for the programmer if the "least representable value" for _Bool is 0, and the "largest representable value" is 1, despite the underlying representation taking at least a byte of storage. There doesn't seem to be a consensus among several compilers I've checked; e.g., consider the following program:When any scalar value is converted to _Bool, the result is 0 if the value compares equal

to 0; otherwise, the result is 1.

Code: Select all

```
#include <stdio.h>
int main(void) {
_Bool min_val = 1, max_val = 0;
#pragma omp parallel reduction(min:min_val) reduction(max:max_val) \
num_threads(1)
{
printf("min_val: %i\n", min_val);
printf("max_val: %i\n", max_val);
}
}
```

Code: Select all

```
min_val: 1
max_val: 0
```

Code: Select all

```
min_val: 255
max_val: 0
```

Code: Select all

```
min_val: 127
max_val: -128
```