summaryrefslogtreecommitdiffstats
path: root/iwyu
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2021-08-24 17:27:32 +0200
committerBenBE <BenBE@geshi.org>2021-08-25 09:54:30 +0200
commitc243db0b2c918f666f6510ae4b464ed88b1715b8 (patch)
treeef7adc4d78c5ea295456a4515813373365f84afa /iwyu
parenta18018ed48bb20b8e0ad48f1f802e117f01f8ceb (diff)
XUtils: move implementation of String_contains_i out of header file
The function strcasestr(3) is only available if _GNU_SOURCE is defined. If any file includes <string.h> before declaring _GNU_SOURCE, e.g by including "config.h", compilation fails with the following error: In file included from ColumnsPanel.c:8: In file included from ./ColumnsPanel.h:12: In file included from ./Panel.h:13: In file included from ./CRT.h:16: In file included from ./Settings.h:17: In file included from ./Process.h:15: In file included from ./Object.h:17: ./XUtils.h:42:11: error: implicit declaration of function 'strcasestr' is invalid in C99 [-Werror,-Wimplicit-function-declaration] return strcasestr(s1, s2) != NULL; ^ ./XUtils.h:42:11: note: did you mean 'strcasecmp'? /usr/include/strings.h:116:12: note: 'strcasecmp' declared here extern int strcasecmp (const char *__s1, const char *__s2) ^ Move the implementation to avoid unnecessary includes. Since LTO is quite common and stable performance should not be impacted if used.
Diffstat (limited to 'iwyu')
0 files changed, 0 insertions, 0 deletions

© 2014-2024 Faster IT GmbH | imprint | privacy policy