Skip to content

Source: Avoid gcc 12 compilation warning

Brad King requested to merge brad.king/cmake:gcc12-warning into master

GCC 12 warns:

warning: '%04d' directive output may be truncated writing between
4 and 11 bytes into a region of size 5 [-Wformat-truncation=]

The surrounding logic guarantees the formatted integer will never be more than 4 bytes, but it doesn't hurt to use a larger buffer. This GCC behavior is documented.

Merge request reports