C error: function pointer expected
Describe the bug
C error: function pointer expected
Reproduction Steps
git clone [email protected]:einar-hjortdal/firebird.git \
&& cd firebird \
&& git checkout ecba31c3cb1a56e80f49599cdee14131547ded38 \
&& v run src/secure_remote_password_test.v
Expected Behavior
No C error
Current Behavior
C error
Possible Solution
No response
Additional Information/Context
No response
V version
V 0.4.7 263ba23
Environment details (OS name and version, etc.)
V full version: V 0.4.7 ace4e93.263ba23 OS: linux, Linux version 5.14.0-427.33.1.el9_4.x86_64 (mockbuild@pp-el9) (gcc (GCC) 11.4.1 20231218 (Red Hat 11.4.1-3), GNU ld version 2.35.2-43.el9) #1 SMP PREEMPT_DYNAMIC Thu Aug 29 12:00:49 CEST 2024 Processor: 8 cpus, 64bit, little endian, Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz
getwd: /home/einar/Documents/projects/vlang/active/firebird vexe: /home/einar/.local/lib64/v/v vexe mtime: 2024-09-18 16:47:41
vroot: OK, value: /home/einar/.local/lib64/v VMODULES: OK, value: /home/einar/.vmodules VTMP: OK, value: /tmp/v_1001
Git version: git version 2.43.5 Git vroot status: weekly.2024.37-25-g263ba232 .git/config present: true
CC version: cc (GCC) 11.4.1 20231218 (Red Hat 11.4.1-3) thirdparty/tcc status: thirdparty-linux-amd64 0134e9b9
[!NOTE] You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote. Other reactions and those to comments will not be taken into account.
The problem is the name clashing. See:
Array_u8 string_bytes = firebird__marshal_array_u8(string_bytes(s));
V s.bytes() turns into string_bytes(s) C code, which crashes.
@spytheman @medvednikov what do you guys suggest for this cases?
Is there a workaround I can use in the meantime? Development is stalled because of this error
Is there a workaround I can use in the meantime? Development is stalled because of this error
The error is here
fn (mut p WireProtocol) pack_string(s string) {
string_bytes := marshal_array_u8(s.bytes())
p.buf = arrays.append(p.buf, string_bytes)
}
Just change string_bytes to strings_bytes_ for now
@felipensp would adding a default name mangling for user defined variables, functions, types, etc. and a different one for all internal auto generated types be a viable solution? ie. prefixing all user variables and functions with __VU_ and all internal library variables and std library functions with __VI_?
@felipensp would adding a default name mangling for user defined variables, functions, types, etc. and a different one for all internal auto generated types be a viable solution? ie. prefixing all user variables and functions with
__VU_and all internal library variables and std library functions with__VI_?
Yeah, I already thought about this approach. What do you think @medvednikov ?
Why not postfix userland function names with a hash?
Why not postfix userland function names with a hash?
is there a benefit to a hash over just an int counter like is used for anonymous... I believe structs?
Related to issue #17831
Why not postfix userland function names with a hash?
is there a benefit to a hash over just an int counter like is used for anonymous... I believe structs?
Hashes are more unique, but now I think an int counter is just fine.