I've spent several hours on https://github.com/systemd/systemd/pull/27595, which fixes a wrong use of the "pure" attribute. Consider the following: $ cat t.c extern int t(const char *, int *); int t(const char *a, int *b) { if (!a) return 114; *b = __builtin_strlen(a); return 0; } $ gcc t.c -S -Wall -Wextra -Werror && echo "no warning" no warning $ gcc t.c -S -Wall -Wextra -Werror -O1 && echo "no warning" no warning $ gcc t.c -S -Wall -Wextra -Werror -O2 && echo "no warning" no warning $ gcc t.c -S -Wall -Wextra -Werror -O3 && echo "no warning" no warning $ gcc t.c -S -Wall -Wextra -Werror -O3 -fanalyzer && echo "no warning" no warning If we had a warning here, it would have saved me several hours :).
Dup of bug 18487. *** This bug has been marked as a duplicate of bug 18487 ***