gcc-4.9 Undefined Behavior Sanitizer

后端 未结 2 1532
甜味超标
甜味超标 2020-12-13 01:58

In gcc-4.9 changes it says:

UndefinedBehaviorSanitizer (ubsan), a fast undefined behavior detector, has been added and can be enabled via -fsanitize

2条回答
  •  猫巷女王i
    2020-12-13 02:44

    Complete list of options listed in UndefinedBehaviorSanitizer

    Latest GCC 5.0 additions extracted from GCC 5 Release Series : Changes, New Features, and Fixes listed below;

    UndefinedBehaviorSanitizer gained a few new sanitization options:

    -fsanitize=float-divide-by-zero: detect floating-point division by zero;
    -fsanitize=float-cast-overflow: check that the result of floating-point type to integer conversions do not overflow;
    -fsanitize=bounds: enable instrumentation of array bounds and detect out-of-bounds accesses;
    -fsanitize=alignment: enable alignment checking, detect various misaligned objects;
    -fsanitize=object-size: enable object size checking, detect various out-of-bounds accesses.
    -fsanitize=vptr: enable checking of C++ member function calls, member accesses and some conversions between pointers to base and derived classes, detect if the referenced object does not have the correct dynamic type.
    

提交回复
热议问题