ui icon indicating copy to clipboard operation
ui copied to clipboard

Incompatible pointer type compilation example under GCC 14

Open odiroot opened this issue 9 months ago • 1 comments

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 avatar May 22 '24 20:05 odiroot