Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 916039 - =app-editors/ghex-45.0 does not compile with Clang: gtkhex.c:1945:4: error: expected expression
Summary: =app-editors/ghex-45.0 does not compile with Clang: gtkhex.c:1945:4: error: e...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks: systemwide-clang
  Show dependency tree
 
Reported: 2023-10-20 06:55 UTC by David Carlos Manuelda
Modified: 2024-03-24 20:46 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Fix declaration inside switch (fix-declaration-inside-switch.patch,672 bytes, patch)
2023-10-20 06:56 UTC, David Carlos Manuelda
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Carlos Manuelda 2023-10-20 06:55:50 UTC
The error is ../ghex-45.0/src/gtkhex.c:1945:4: error: expected expression
 1945 |                         gint64 line_beg = self->cursor_pos;

And happens because it is not permitted to declare variables inside switch despite gcc seems to allow it but clang don't

Reproducible: Always
Comment 1 David Carlos Manuelda 2023-10-20 06:56:47 UTC
Created attachment 873171 [details, diff]
Fix declaration inside switch

The issue is fixed by moving the local variable declarations to outside of the switch
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-10-21 16:56:40 UTC
Please submit an MR upstream and they'll surely merge it then.
Comment 3 David Carlos Manuelda 2024-02-12 05:14:21 UTC
Notice: Fixed upstream in https://gitlab.gnome.org/GNOME/ghex/-/commit/b00b8332ab19e41c75ce143f45ab4585502c020b with a slightly different aproach
Comment 4 Mart Raudsepp gentoo-dev 2024-03-24 19:23:21 UTC
Weird that 44.2 and 45.0 compiled fine for me with clang-18.1.0
Comment 5 Mart Raudsepp gentoo-dev 2024-03-24 19:25:12 UTC
ah, I get it as a warning (and due to lack of emerge --info I don't know if it's a clang version or what):

../ghex-45.0/src/gtkhex.c:1944:4: warning: label followed by a declaration is a C23 extension [-Wc23-extensions]
 1944 |                         gint64 line_beg = self->cursor_pos;
      |                         ^
../ghex-45.0/src/gtkhex.c:1954:4: warning: label followed by a declaration is a C23 extension [-Wc23-extensions]
 1954 |                         gint64 line_end = self->cursor_pos;
      |                         ^
Comment 6 Larry the Git Cow gentoo-dev 2024-03-24 20:46:34 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=39c9f7c09b7b28cebce2cd3c7b0fcc9d9763041a

commit 39c9f7c09b7b28cebce2cd3c7b0fcc9d9763041a
Author:     Mart Raudsepp <leio@gentoo.org>
AuthorDate: 2024-03-24 19:26:27 +0000
Commit:     Mart Raudsepp <leio@gentoo.org>
CommitDate: 2024-03-24 20:45:01 +0000

    app-editors/ghex: add 45.2, add missing dep
    
    Closes: https://bugs.gentoo.org/913726
    Closes: https://bugs.gentoo.org/916039
    Signed-off-by: Mart Raudsepp <leio@gentoo.org>

 app-editors/ghex/Manifest         |  1 +
 app-editors/ghex/ghex-45.2.ebuild | 66 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 67 insertions(+)