intel / ledmon

Enclosure LED Utilities
GNU General Public License v2.0
72 stars 44 forks source link

Prevent compiler from optimizing out security checks #146

Closed ktanska closed 10 months ago

ktanska commented 11 months ago

C/C++ compiler optimizations can assume that code does not have undefined behaviors. This causes security flaws when code checks for undefined behaviors, such as integer overflows and buffer overruns, are optimized out by the compiler. Add compiler flags which restrict the compiler from making arbitrary decisions while handling undefined behaviors.