Commit 24cd9bc
committed
sprandom: fix warning: comparison will always evaluate as true
The log_buf() macro checks whether the buffer is NULL, but in this
case the variable is defined on the stack and can never be NULL.
Use the low-level __log_buf() function to eliminate the warning.
Fixes the following warning with 32-bit build:
LDFLAGS="-m32" ./configure --disable-native --extra-cflags="-m32 -march=i386" && make
sprandom.c: In function ‘print_d_array’:
log.h:24:12: warning: the comparison will always evaluate as ‘true’ \
for the address of ‘out’ will never be NULL [-Waddress]
if ((buf) != NULL) \
Reported-by: Sitsofe Wheeler <[email protected]>
Signed-off-by: Tomas Winkler <[email protected]>1 parent 80d72cb commit 24cd9bc
1 file changed
+6
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
| 123 | + | |
124 | 124 | | |
125 | | - | |
| 125 | + | |
126 | 126 | | |
127 | | - | |
| 127 | + | |
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
| 142 | + | |
143 | 143 | | |
144 | | - | |
| 144 | + | |
145 | 145 | | |
146 | | - | |
| 146 | + | |
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| |||
0 commit comments