MantisBT - Buildsystem
View Issue Details
0002815Buildsystem[All Projects] Generalpublic2021-04-14 16:292024-01-02 04:31
ReporterRyan Carsten Schmidt 
Assigned To 
Platformx86_64OSmacOSOS Version10.13.6
Fixed in CI build #
Reported in CI build #
Summary0002815: implicit declaration of function 'strcasestr' is invalid in C99
DescriptionTrying to build NetSurf 3.10 on macOS 10.13.6 (with -Werror=implicit-function-declaration in CFLAGS, in order to simulate what happens by default with newer versions of Xcode clang) with the gtk3 target failed as follows:

content/handlers/html/css.c:229:7: error: implicit declaration of function 'strcasestr' is invalid in C99 [-Werror,-Wimplicit-function-declaration]

In /usr/include/string.h, strcasestr is declared within a conditional:

/* Darwin extensions */

char *strcasestr(const char *__big, const char *__little);

I worked around the problem by adding -D_DARWIN_C_SOURCE to CFLAGS, similar to the way that you already use -D_BSD_SOURCE, -D_DEFAULT_SOURCE, and -D_NETBSD_SOURCE in frontends/gtk/Makefile.
Steps To ReproduceBuild NetSurf 3.10 on any version of macOS with -Werror=implicit-function-declaration in CFLAGS.
TagsNo tags attached.
Attached Files

Ryan Carsten Schmidt   
2024-01-02 04:31   
This problem remains in NetSurf 3.11.

Issue History
2021-04-14 16:29Ryan Carsten SchmidtNew Issue
2024-01-02 04:31Ryan Carsten SchmidtNote Added: 0002429