Implicit Function Declaration causes compilation to fail
The error is:
[3454/3560] Compiling C object src/gnome-text-editor.exe.p/editor-page.c.obj
FAILED: src/gnome-text-editor.exe.p/editor-page.c.obj
"cc" "-Isrc/gnome-text-editor.exe.p" "-Isrc" "-I../src" "-I." "-I.." "-Isrc/editorconfig" "-I../src/editorconfig" "-Isubprojects/glib/gio" "-I../subprojects/glib/gio" "-Isubprojects/glib/gmodule" "-I../subprojects/glib/gmodule" "-Isubprojects/glib" "-I../subprojects/glib" "-Isubprojects/glib/glib" "-I../subprojects/glib/glib" "-Isubprojects/glib/gobject" "-I../subprojects/glib/gobject" "-Isubprojects/gtk" "-I../subprojects/gtk" "-Isubprojects/gtk/gtk" "-I../subprojects/gtk/gtk" "-I../subprojects/gtk/gdk/x11" "-Isubprojects/gtk/gdk" "-I../subprojects/gtk/gdk" "-Isubprojects/gtksourceview" "-I../subprojects/gtksourceview" "-Isubprojects/libadwaita/src" "-I../subprojects/libadwaita/src" "-Isubprojects/gtk/gtk/css" "-Isubprojects/gtk/gsk" "-Isubprojects/gtksourceview/gtksourceview" "-IC:/msys64/mingw64/include/pango-1.0" "-IC:/msys64/mingw64/include" "-IC:/msys64/mingw64/include/glib-2.0" "-IC:/msys64/mingw64/lib/glib-2.0/include" "-IC:/msys64/mingw64/include/harfbuzz" "-IC:/msys64/mingw64/include/freetype2" "-IC:/msys64/mingw64/include/libpng16" "-IC:/msys64/mingw64/include/fribidi" "-IC:/msys64/mingw64/include/cairo" "-IC:/msys64/mingw64/include/lzo" "-IC:/msys64/mingw64/include/pixman-1" "-IC:/msys64/mingw64/include/gdk-pixbuf-2.0" "-IC:/msys64/mingw64/include/graphene-1.0" "-IC:/msys64/mingw64/lib/graphene-1.0/include" "-IC:/msys64/mingw64/include/libxml2" "-IC:/msys64/mingw64/include/enchant-2" "-fdiagnostics-color=always" "-D_FILE_OFFSET_BITS=64" "-Wall" "-Winvalid-pch" "-Wextra" "-std=gnu17" "-O0" "-g" "-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_74" "-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_74" "-DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_4_8" "-DGDK_VERSION_MAX_ALLOWED=GDK_VERSION_4_8" "-DGTK_SOURCE_VERSION_MIN_REQUIRED=GTK_SOURCE_VERSION_5_6" "-DGTK_SOURCE_VERSION_MAX_ALLOWED=GTK_SOURCE_VERSION_5_6" "-Wcast-align" "-Wdeclaration-after-statement" "-Werror=address" "-Werror=array-bounds" "-Werror=empty-body" "-Werror=implicit" "-Werror=implicit-function-declaration" "-Werror=init-self" "-Werror=int-conversion" "-Werror=int-to-pointer-cast" "-Werror=main" "-Werror=misleading-indentation" "-Werror=missing-braces" "-Werror=missing-include-dirs" "-Werror=nonnull" "-Werror=overflow" "-Werror=pointer-arith" "-Werror=pointer-to-int-cast" "-Werror=return-type" "-Werror=sequence-point" "-Werror=shadow" "-Werror=strict-prototypes" "-Werror=trigraphs" "-Werror=undef" "-Werror=write-strings" "-Wformat-nonliteral" "-Werror=format-security" "-Werror=format=2" "-Wignored-qualifiers" "-Wimplicit-function-declaration" "-Wlogical-op" "-Wmissing-format-attribute" "-Wmissing-include-dirs" "-Wmissing-noreturn" "-Wnested-externs" "-Wno-cast-function-type" "-Wno-missing-field-initializers" "-Wno-sign-compare" "-Wno-unused-parameter" "-Wold-style-definition" "-Wpointer-arith" "-Wstrict-prototypes" "-Wswitch-default" "-Wswitch-enum" "-Wundef" "-Wuninitialized" "-Wunused" "-fno-strict-aliasing" "-fstack-protector-strong" "-fstack-protector-strong" "-Wmissing-declarations" "-mms-bitfields" "-mms-bitfields" "-mms-bitfields" "-mms-bitfields" "-mms-bitfields" "-mms-bitfields" "-mms-bitfields" "-mfpmath=sse" "-msse" "-msse2" "-mms-bitfields" "-mms-bitfields" "-mms-bitfields" "-mms-bitfields" "-mms-bitfields" "-DHAVE_ENCHANT" -MD -MQ src/gnome-text-editor.exe.p/editor-page.c.obj -MF "src/gnome-text-editor.exe.p/editor-page.c.obj.d" -o src/gnome-text-editor.exe.p/editor-page.c.obj "-c" ../src/editor-page.c
../src/editor-page.c: In function 'editor_page_dup_subtitle':
../src/editor-page.c:1030:55: error: implicit declaration of function 'getuid'; did you mean 'getpid'? [-Werror=implicit-function-declaration]
1030 | docportal = g_strdup_printf ("/run/user/%u/doc/", getuid ());
| ^~~~~~
| getpid
../src/editor-page.c:1030:55: warning: nested extern declaration of 'getuid' [-Wnested-externs]
cc1.exe: some warnings being treated as errors
To reproduce run
git clone https://gitlab.gnome.org/Zacharymk1213/gnome-text-editor.git
cd gnome-text-editor
meson setup builddir -Dforce_fallback_for=libadwaita,glib,gtk4,binutils,gtksourceview
The raw from my pipeline: https://gitlab.gnome.org/Zacharymk1213/gnome-text-editor/-/jobs/2197096/raw
Edited by Zachary