This code fails to compile in QB64 v1.3:
It also fails when using a variable suffix:
I thought maybe the "0" being passed in to my function was not being seen as an _UNSIGNED _BIT, but it still fails when using a typed variable:
UnsignedBit = 0
foo$ = "something"
Could someone test if that fails on QB64 v1.5?
I read the QB64 v1.4 and v1.5 changelog and decided an update wasn't needed for my current small project.
The error from the compiler is this:
In file included from ..\\temp\\main.txt:23,
from qbx.cpp:2171:
..\\temp\\data1.txt: In function 'qbs* FUNC_FOO(unsigned int*)':
..\\temp\\data1.txt:3:9: error: declaration of 'unsigned int* _FUNC_FOO_UBIT1_MY_VARIABLE' shadows a parameter
uint32 *_FUNC_FOO_UBIT1_MY_VARIABLE=NULL;
^~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated due to -Wfatal-errors.
I read online that "shadows a parameter" has to do with a function parameter using the same name as a variable in the function, but it's failing on an empty function.
Breaking down the error message I can see:
_FUNC_FOO_UBIT1_MY_VARIABLE unsigned int*
_FUNC_FOO_UBIT1_MY_VARIABLE uint32*
I'm not super familiar with the C++ variable types, but it looks like there are two separate types of unsigned integers being used by QB64 in different areas, which is causing the compiler to interpret them as separate variables.
Questions:
- Are _UNSIGNED _BIT variables not intended to be passed to FUNCTIONs?
If so, it would be to have QB64 catch this error in the editor. - Or is there something else I'm missing in the way I'm calling the function?