vlang / ui

A cross-platform UI library written in V
MIT License
2.31k stars 154 forks source link

Incompatible pointer type compilation example under GCC 14 #575

Open odiroot opened 1 month ago

odiroot commented 1 month ago

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 commented 1 month ago

Also confirmed the code working with GCC 13.3.0.