07-04-2025, 07:52 PM
Hello,
I don't understand why the following code crashes during compilation.
I understood that a function should not return a type defined by TYPE, but that native types were permitted ?
compilelog.txt says that :
g++ -no-pie -std=gnu++17 -fno-strict-aliasing -Wno-conversion-null -DFREEGLUT_STATIC -I./internal/c/libqb/include -I./internal/c/parts/core/freeglut/include -I./internal/c/parts/core/glew/include -DDEPENDENCY_NO_SOCKETS -DDEPENDENCY_NO_PRINTER -DDEPENDENCY_NO_ICON -DDEPENDENCY_NO_SCREENIMAGE internal/c/qbx.cpp -c -o internal/c/qbx.o
In file included from internal/c/qbx.cpp:1742:
internal/c/../temp/main.txt: In function ‘float FUNC_TEST()’:
internal/c/../temp/main.txt:30:31: error: cannot convert ‘mem_block’ to ‘float’ in assignment
30 | *_FUNC_TEST_SINGLE_TEST=(func2=func__memnew( 1753 ));
| ~~~~~~^~~~~~~~~~~~~~~~~~~~~~
| |
| mem_block
make: *** [Makefile:413 : internal/c/qbx.o] Erreur 1
I don't understand why the following code crashes during compilation.
I understood that a function should not return a type defined by TYPE, but that native types were permitted ?
Code: (Select All)
print test.size
declare function test as _mem
function test ()
test = _memnew(1753)
end functiong++ -no-pie -std=gnu++17 -fno-strict-aliasing -Wno-conversion-null -DFREEGLUT_STATIC -I./internal/c/libqb/include -I./internal/c/parts/core/freeglut/include -I./internal/c/parts/core/glew/include -DDEPENDENCY_NO_SOCKETS -DDEPENDENCY_NO_PRINTER -DDEPENDENCY_NO_ICON -DDEPENDENCY_NO_SCREENIMAGE internal/c/qbx.cpp -c -o internal/c/qbx.o
In file included from internal/c/qbx.cpp:1742:
internal/c/../temp/main.txt: In function ‘float FUNC_TEST()’:
internal/c/../temp/main.txt:30:31: error: cannot convert ‘mem_block’ to ‘float’ in assignment
30 | *_FUNC_TEST_SINGLE_TEST=(func2=func__memnew( 1753 ));
| ~~~~~~^~~~~~~~~~~~~~~~~~~~~~
| |
| mem_block
make: *** [Makefile:413 : internal/c/qbx.o] Erreur 1

