diff --git a/pkgs/by-name/gt/gtkhtml/package.nix b/pkgs/by-name/gt/gtkhtml/package.nix
index 97782684a54d..ffba374d13c8 100644
--- a/pkgs/by-name/gt/gtkhtml/package.nix
+++ b/pkgs/by-name/gt/gtkhtml/package.nix
@@ -32,6 +32,8 @@ stdenv.mkDerivation rec {
hash = "sha256-f0OToWGHZwxvqf+0qosfA9FfwJ/IXfjIPP5/WrcvArI=";
extraPrefix = "";
})
+ # Resolves a GCC14 missing typecast error
+ ./typecast.diff
];
passthru = {
diff --git a/pkgs/by-name/gt/gtkhtml/typecast.diff b/pkgs/by-name/gt/gtkhtml/typecast.diff
new file mode 100644
index 000000000000..5903e8b49cba
--- /dev/null
+++ b/pkgs/by-name/gt/gtkhtml/typecast.diff
@@ -0,0 +1,13 @@
+diff --git a/components/editor/gtkhtml-editor.c b/components/editor/gtkhtml-editor.c
+index 902baf94..d885df8c 100644
+--- a/components/editor/gtkhtml-editor.c
++++ b/components/editor/gtkhtml-editor.c
+@@ -455,7 +455,7 @@ editor_set_html (GtkhtmlEditor *editor,
+ gtk_html_load_empty (html);
+ gtk_html_set_editable (html, TRUE);
+
+- editor->priv->edit_area = g_object_ref_sink (html);
++ editor->priv->edit_area = (GtkWidget *) g_object_ref_sink (html);
+ }
+
+ static GObject *