Skip to content

Importing encoding.binary into module causes C compilation error #24921

Description

@libdev-hacker

Describe the bug

Importing encoding.binary into a module causes a "compiler bug" at build-time, however it doesn't appear when importing it from within the V REPL

Reproduction Steps

AFAIK, just putting import encoding.binary into a file causes this to happen

Expected Behavior

To be able to access all the functions within encoding.binary without it failing to compile

Current Behavior

The following error gets printed via the command: v . -show-c-output:

======== Output of the C Compiler (/opt/v/thirdparty/tcc/tcc.exe) ========
/tmp/v_1000/advertise.01K0CSQ3BKT5PEMXGS1XHJ4QMM.tmp.c:904: error: ';' expected (got "Map_string_encoding__binary__Any")
==========================================================================
======== Output of the C Compiler (cc) ========
/tmp/v_1000/advertise.01K0CSQ3BKT5PEMXGS1XHJ4QMM.tmp.c:904:17: error: unknown type name ‘Map_string_encoding__binary__Any’
  904 |                 Map_string_encoding__binary__Any* _Map_string_encoding__binary__Any;
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/v_1000/advertise.01K0CSQ3BKT5PEMXGS1XHJ4QMM.tmp.c:905:17: error: unknown type name ‘Map_int_encoding__binary__Any’
  905 |                 Map_int_encoding__binary__Any* _Map_int_encoding__binary__Any;
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
===============================================

Possible Solution

No response

Additional Information/Context

No response

V version

V 0.4.11 cb8b8f2

Environment details (OS name and version, etc.)

V full version V 0.4.11 54fec7b.cb8b8f2
OS linux, Linux Mint 22.1
Processor 6 cpus, 64bit, little endian, AMD Ryzen 5 4500U with Radeon Graphics
Memory 0.32GB/7.12GB
V executable /opt/v/v
V last modified time 2025-07-17 18:27:04
V home dir OK, value: /opt/v
VMODULES OK, value: ~/.vmodules
VTMP OK, value: /tmp/v_1000
Current working dir OK, value: ~/Projects/ldn/libldn
Git version git version 2.43.0
V git status cb8b8f2
.git/config present true
cc version cc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
gcc version gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
clang version N/A
tcc version tcc version 0.9.28rc 2025-02-13 HEAD@f8bd136d (x86_64 Linux)
tcc git status thirdparty-linux-amd64 696c1d84
emcc version N/A
glibc version ldd (Ubuntu GLIBC 2.39-0ubuntu8.5) 2.39

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.

Metadata

Metadata

Assignees

Labels

BugThis tag is applied to issues which reports bugs.Unit: markusedBugs/feature requests, that are related to the -skip-unused.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions