* [PATCH] compat: probe for strcasestr more thoroughly
@ 2023-08-26 14:53 michaeljgruber+grubix+git
2023-08-27 16:38 ` Tomi Ollila
2023-08-31 13:12 ` David Bremner
0 siblings, 2 replies; 3+ messages in thread
From: michaeljgruber+grubix+git @ 2023-08-26 14:53 UTC (permalink / raw)
To: notmuch; +Cc: Michael J Gruber, Thomas Schneider, Florian Weimer, Tomi Ollila
From: Michael J Gruber <git@grubix.eu>
Depending on compiler (gcc, g++, clang) and standard options (c99, c11),
string.h may or may not include strings.h, leading to possibly missing
or conflicting declarations of strcasestr.
Include both so that both detection and compilation phases use the same
(possibly optimised) implementations.
Suggested-by: Thomas Schneider <qsx@chaotikum.eu>
Suggested-by: Florian Weimer <fweimer@redhat.com>
Suggested-by: Tomi Ollila <tomi.ollila@iki.fi>
---
This is related to the discussion here:
https://nmbug.notmuchmail.org/nmweb/show/20221202191908.848227-1-qsx%40chaotikum.eu>
We've been carrying FW's version of the patch in Fedora since January.
The one here is TO's version of TS's original and tested in Fedora.
compat/have_strcasestr.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/compat/have_strcasestr.c b/compat/have_strcasestr.c
index 3cd1838d..8e004572 100644
--- a/compat/have_strcasestr.c
+++ b/compat/have_strcasestr.c
@@ -1,5 +1,6 @@
#define _GNU_SOURCE
-#include <strings.h>
+#include <strings.h> /* strcasecmp() in POSIX */
+#include <string.h> /* strcasecmp() in *BSD */
int
main ()
--
2.42.0.290.gfcfb41f205
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] compat: probe for strcasestr more thoroughly
2023-08-26 14:53 [PATCH] compat: probe for strcasestr more thoroughly michaeljgruber+grubix+git
@ 2023-08-27 16:38 ` Tomi Ollila
2023-08-31 13:12 ` David Bremner
1 sibling, 0 replies; 3+ messages in thread
From: Tomi Ollila @ 2023-08-27 16:38 UTC (permalink / raw)
To: michaeljgruber+grubix+git, notmuch
Cc: Michael J Gruber, Thomas Schneider, Florian Weimer
On Sat, Aug 26 2023, michaeljgruber wrote:
> From: Michael J Gruber <git@grubix.eu>
>
> Depending on compiler (gcc, g++, clang) and standard options (c99, c11),
> string.h may or may not include strings.h, leading to possibly missing
> or conflicting declarations of strcasestr.
>
> Include both so that both detection and compilation phases use the same
> (possibly optimised) implementations.
>
> Suggested-by: Thomas Schneider <qsx@chaotikum.eu>
> Suggested-by: Florian Weimer <fweimer@redhat.com>
> Suggested-by: Tomi Ollila <tomi.ollila@iki.fi>
> ---
LGTM :D
Tomi
> This is related to the discussion here:
> https://nmbug.notmuchmail.org/nmweb/show/20221202191908.848227-1-qsx%40chaotikum.eu>
>
> We've been carrying FW's version of the patch in Fedora since January.
> The one here is TO's version of TS's original and tested in Fedora.
>
> compat/have_strcasestr.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/compat/have_strcasestr.c b/compat/have_strcasestr.c
> index 3cd1838d..8e004572 100644
> --- a/compat/have_strcasestr.c
> +++ b/compat/have_strcasestr.c
> @@ -1,5 +1,6 @@
> #define _GNU_SOURCE
> -#include <strings.h>
> +#include <strings.h> /* strcasecmp() in POSIX */
> +#include <string.h> /* strcasecmp() in *BSD */
>
> int
> main ()
> --
> 2.42.0.290.gfcfb41f205
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] compat: probe for strcasestr more thoroughly
2023-08-26 14:53 [PATCH] compat: probe for strcasestr more thoroughly michaeljgruber+grubix+git
2023-08-27 16:38 ` Tomi Ollila
@ 2023-08-31 13:12 ` David Bremner
1 sibling, 0 replies; 3+ messages in thread
From: David Bremner @ 2023-08-31 13:12 UTC (permalink / raw)
To: notmuch@notmuchmail.org
Cc: Michael J Gruber, Thomas Schneider, Florian Weimer, Tomi Ollila
michaeljgruber+grubix+git@gmail.com writes:
> From: Michael J Gruber <git@grubix.eu>
>
> Depending on compiler (gcc, g++, clang) and standard options (c99, c11),
> string.h may or may not include strings.h, leading to possibly missing
> or conflicting declarations of strcasestr.
>
> Include both so that both detection and compilation phases use the same
> (possibly optimised) implementations.
applied to release and master
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-08-31 13:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-26 14:53 [PATCH] compat: probe for strcasestr more thoroughly michaeljgruber+grubix+git
2023-08-27 16:38 ` Tomi Ollila
2023-08-31 13:12 ` David Bremner
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).