Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatible pointer type compilation example under GCC 14 #575

Open
odiroot opened this issue May 22, 2024 · 1 comment
Open

Incompatible pointer type compilation example under GCC 14 #575

odiroot opened this issue May 22, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@odiroot
Copy link

odiroot commented May 22, 2024

V version: V 0.4.6 7a36b44
UI version: 0.04
GCC version: 14.1.1 20240507
OS: EndeavourOS Linux x86_64

What did you do?

Tried compiling this basic code with GCC:

import ui

fn main() {
    window := ui.window(
        width: 600
        height: 400
        title: 'Test'
        children: []
    )
    ui.run(window)
}
v -cc gcc hello_ui.v

What did you expect to see?
Expected the code to build and generate a working binary.

What did you see instead?
Compilation error:

/tmp/v_1000/hello_ui.01HYGYTXJ1JXXMYD567XZHNN8R.tmp.c: In function ‘ui__Menu_propagate_connection’:
/tmp/v_1000/hello_ui.01HYGYTXJ1JXXMYD567XZHNN8R.tmp.c:131713:55: error: assignment to ‘ui__MenuItem *’ from incompatible pointer type ‘ui__MenuItem **’ [-Wincompatible-pointer-types]
131713 |                         (*item)->submenu->parent_item = item;
       |                                                       ^
...

The same code actually compiles when using tcc

@odiroot odiroot added the bug Something isn't working label May 22, 2024
@odiroot
Copy link
Author

odiroot commented May 22, 2024

Also confirmed the code working with GCC 13.3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant