build: enable -fanalyzer for static analysis

Enable gccs static analyzer to detect memory bugs at compile-time. This
validates our __attribute__((__cleanup__)) macros and improves security
when parsing external XMPP data with zero runtime overhead.
This commit is contained in:
Michael Vetter
2026-02-26 16:28:00 +01:00
parent 606a10208a
commit ec45a19c72

View File

@@ -69,6 +69,9 @@ if is_debug
'-D_FORTIFY_SOURCE=2',
'-Og'
], language: 'c')
if cc.get_id() == 'gcc'
add_project_arguments('-fanalyzer', language: 'c')
endif
endif
if cc.get_id() == 'clang'