Re: [hackers] [dmenu] follow-up fix: add -D_GNU_SOURCE for strcasestr for some systems || Hiltjo Posthuma

From: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Mon, 7 Feb 2022 13:36:24 +0100

On Mon, Feb 07, 2022 at 10:41:58AM +0100, Laslo Hunhold wrote:
> On Mon, 7 Feb 2022 10:36:46 +0100 (CET)
> git_AT_suckless.org wrote:
>
> Dear Hiltjo,
>
> > follow-up fix: add -D_GNU_SOURCE for strcasestr for some systems
>
> wouldn't it be better to avoid GNU-extensions in code?
>
> With best regards
>
> Laslo
>

I kindof expected a reply like this. In general I don't disagree.

This function is available on many systems for decades.

On some systems like OpenBSD the -D_GNU_SOURCE is not needed.
It's man page says:

"HISTORY
     The strstr() function first appeared in 4.3BSD-Reno. The strcasestr()
     function appeared in glibc 2.1, was reimplemented for FreeBSD 4.5 and
     ported to OpenBSD 3.8."

glibc 2.1 was released in 1999:
https://sourceware.org/glibc/wiki/Glibc%20Timeline

OpenBSD 3.8 was released in 2005.

So whats the issue?

-- 
Kind regards,
Hiltjo
Received on Mon Feb 07 2022 - 13:36:24 CET

This archive was generated by hypermail 2.3.0 : Mon Feb 07 2022 - 13:48:30 CET