diff mbox series

[bug#63159,1/2] gnu: slim: Fix build failure with GCC-11

Message ID 70e16c55304b4235a9d72913a2c9bd8e6a3d0da0.1682717123.git.bjc@spork.org
State New
Headers show
Series [bug#63159,1/2] gnu: slim: Fix build failure with GCC-11 | expand

Commit Message

Brian Cully April 28, 2023, 9:25 p.m. UTC
GCC-11 sniffed out a long-standing bug where a pointer was being tested for a
negative value, which is impossible. Instead, check for NULL, which is how the
error result is actually returned.

See https://github.com/iwamatsu/slim/issues/14 for details.

* gnu/packages/display-managers.scm (slim) [fix-0-pointer-comparison]: new
phase
---
 gnu/packages/display-managers.scm | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Brian Cully April 28, 2023, 9:28 p.m. UTC | #1
This patch fixes #63155

-bjc
Ludovic Courtès April 30, 2023, 9:16 p.m. UTC | #2
Hi,

Brian Cully <bjc@spork.org> skribis:

> GCC-11 sniffed out a long-standing bug where a pointer was being tested for a
> negative value, which is impossible. Instead, check for NULL, which is how the
> error result is actually returned.
>
> See https://github.com/iwamatsu/slim/issues/14 for details.
>
> * gnu/packages/display-managers.scm (slim) [fix-0-pointer-comparison]: new
> phase

[...]

> Moved to github, according to https://www.berlios.de/software/slim/.
>
> * gnu/packages/display-managers.scm (slim) [home-page]:  update URL.

Applied, thanks!

Ludo’.
diff mbox series

Patch

diff --git a/gnu/packages/display-managers.scm b/gnu/packages/display-managers.scm
index b0d388f1bc..c1a08e8553 100644
--- a/gnu/packages/display-managers.scm
+++ b/gnu/packages/display-managers.scm
@@ -475,7 +475,11 @@  (define-public slim
                ;; The build system's logic here is: if "Linux", then
                 ;; "systemd".  Strip that.
                 ""))
-             #t)))
+             #t))
+         (add-before 'configure 'fix-0-pointer-comparison
+           (lambda _
+             (substitute* "panel.cpp"
+               (("WinGC < 0") "WinGC == NULL")))))
        #:configure-flags '("-DUSE_PAM=yes"
                            "-DUSE_CONSOLEKIT=no")
        #:tests? #f))