@@ -148,6 +148,23 @@ Available checks are:
148
148
Issues caught by this sanitizer are not undefined behavior,
149
149
but are often unintentional.
150
150
- ``-fsanitize=integer-divide-by-zero ``: Integer division by zero.
151
+ - ``-fsanitize=implicit-unsigned-bitfield-truncation ``,
152
+ ``-fsanitize=implicit-signed-bitfield-truncation ``: Implicit conversion from
153
+ integer of larger bit width to smaller bitfield, if that results in data
154
+ loss. That is, if the demoted value, after casting back to the original
155
+ width, is not equal to the original value before the downcast.
156
+ The ``-fsanitize=implicit-unsigned-bitfield-truncation `` handles conversions
157
+ between two ``unsigned `` types, while
158
+ ``-fsanitize=implicit-signed-bitfield-truncation `` handles the rest of the
159
+ conversions - when either one, or both of the types are signed.
160
+ Issues caught by these sanitizers are not undefined behavior,
161
+ but are often unintentional.
162
+ - ``-fsanitize=implicit-bitfield-sign-change ``: Implicit conversion from
163
+ integer of larger bit width to smaller bitfield, if that changes the
164
+ sign of the value. That is, if the original value was negative and the
165
+ new value is positive (or zero), or the original value was positive,
166
+ and the new value is negative. Issues caught by this sanitizer are not
167
+ undefined behavior, but are often unintentional.
151
168
- ``-fsanitize=nonnull-attribute ``: Passing null pointer as a function
152
169
parameter which is declared to never be null.
153
170
- ``-fsanitize=null ``: Use of a null pointer or creation of a null
@@ -192,16 +209,16 @@ Available checks are:
192
209
This includes all the checks covered by ``-ftrapv ``, as well as checks for
193
210
signed division overflow (``INT_MIN/-1 ``), but not checks for
194
211
lossy implicit conversions performed before the computation
195
- (see ``-fsanitize=implicit-conversion ``). Both of these two issues are
196
- handled by ``-fsanitize=implicit-conversion `` group of checks.
212
+ (see ``-fsanitize=implicit-integer- conversion ``). Both of these two issues are
213
+ handled by ``-fsanitize=implicit-integer- conversion `` group of checks.
197
214
- ``-fsanitize=unreachable ``: If control flow reaches an unreachable
198
215
program point.
199
216
- ``-fsanitize=unsigned-integer-overflow ``: Unsigned integer overflow, where
200
217
the result of an unsigned integer computation cannot be represented in its
201
218
type. Unlike signed integer overflow, this is not undefined behavior, but
202
219
it is often unintentional. This sanitizer does not check for lossy implicit
203
220
conversions performed before such a computation
204
- (see ``-fsanitize=implicit-conversion ``).
221
+ (see ``-fsanitize=implicit-integer- conversion ``).
205
222
- ``-fsanitize=vla-bound ``: A variable-length array whose bound
206
223
does not evaluate to a positive value.
207
224
- ``-fsanitize=vptr ``: Use of an object whose vptr indicates that it is of
@@ -213,8 +230,9 @@ Available checks are:
213
230
You can also use the following check groups:
214
231
- ``-fsanitize=undefined ``: All of the checks listed above other than
215
232
``float-divide-by-zero ``, ``unsigned-integer-overflow ``,
216
- ``implicit-conversion ``, ``local-bounds `` and the ``nullability-* `` group
217
- of checks.
233
+ ``implicit-integer-conversion ``, ``implicit-bitfield-conversion ``,
234
+ ``implicit-conversion ``, ``local-bounds `` and the ``nullability-* ``
235
+ group of checks.
218
236
- ``-fsanitize=undefined-trap ``: Deprecated alias of
219
237
``-fsanitize=undefined ``.
220
238
- ``-fsanitize=implicit-integer-truncation ``: Catches lossy integral
@@ -223,11 +241,26 @@ You can also use the following check groups:
223
241
- ``-fsanitize=implicit-integer-arithmetic-value-change ``: Catches implicit
224
242
conversions that change the arithmetic value of the integer. Enables
225
243
``implicit-signed-integer-truncation `` and ``implicit-integer-sign-change ``.
226
- - ``-fsanitize=implicit-conversion ``: Checks for suspicious
227
- behavior of implicit conversions. Enables
244
+ - ``-fsanitize=implicit-integer- conversion ``: Checks for suspicious
245
+ behavior of implicit integer conversions. Enables
228
246
``implicit-unsigned-integer-truncation ``,
229
247
``implicit-signed-integer-truncation ``, and
230
248
``implicit-integer-sign-change ``.
249
+ - ``-fsanitize=implicit-bitfield-truncation ``: Catches lossy bitfield
250
+ conversions. Enables ``implicit-signed-bitfield-truncation `` and
251
+ ``implicit-unsigned-bitfield-truncation ``.
252
+ - ``-fsanitize=implicit-bitfield-arithmetic-value-change ``: Catches implicit
253
+ conversions that change the arithmetic value of the bitfield. Enables
254
+ ``implicit-signed-bitfield-truncation `` and ``implicit-bitfield-sign-change ``.
255
+ - ``-fsanitize=implicit-bitfield-conversion ``: Checks for suspicious
256
+ behavior of implicit bitfield conversions. Enables
257
+ ``implicit-unsigned-bitfield-truncation ``,
258
+ ``implicit-signed-bitfield-truncation ``, and
259
+ ``implicit-bitfield-sign-change ``.
260
+ - ``-fsanitize=implicit-conversion ``: Checks for suspicious
261
+ behavior of implicit conversions. Enables
262
+ ``implicit-integer-conversion ``, and
263
+ ``implicit-bitfield-conversion ``.
231
264
- ``-fsanitize=integer ``: Checks for undefined or suspicious integer
232
265
behavior (e.g. unsigned integer overflow).
233
266
Enables ``signed-integer-overflow ``, ``unsigned-integer-overflow ``,
0 commit comments