Skip to content

C Compiler error when using ?fn (...) #24392

Description

@mike-ward

Describe the bug

Building the get-started.v program described below causes a C compiler build error.

Reproduction Steps

(substitute the /Users/mike/gui/src with cloned source

Expected Behavior

Builds program

Current Behavior

~~~~~~~~~~~~~~~~~~~
cc: /tmp/v_501/get-started.01JT8RAFQ1DA0FANRBEKKMJQ4S.tmp.c:20788:482: warning: implicit conversion from enumeration type 'sokol__gfx__LoadAction' to different enumeration type 'sg_load_action' (aka 'enum sg_load_action') [-Wenum-conversion]
...
cc: 26 warnings and 1 error generated.
(note: the original output was 103 lines long; it was truncated to its first 12 lines + the last line)
================================================================
(You can pass `-cg`, or `-show-c-output` as well, to print all the C error messages).
builder error:
==================

Possible Solution

Line 38 in /src/gui/view_button.v is where the problem originates.

Changing from fn(...) to ?fn(...) revealed the issue. (also lines 95, 103).

Additional Information/Context

No response

V version

V 0.4.10 496c017

Environment details (OS name and version, etc.)

V full version V 0.4.10 da3112e.496c017
OS macos, macOS, 15.4.1, 24E263
Processor 8 cpus, 64bit, little endian, Apple M2
Memory 0.15GB/8GB
V executable /Users/mike/Documents/github/v/v
V last modified time 2025-05-01 12:03:30
V home dir OK, value: /Users/mike/Documents/github/v
VMODULES OK, value: /Users/mike/.vmodules
VTMP OK, value: /tmp/v_501
Current working dir OK, value: /Users/mike/Documents/github/gui/src/examples
env VFLAGS "-message-limit 5 -path /Users/mike/Documents/github/gui/src
Git version git version 2.49.0
V git status weekly.2025.17-35-g496c0171
.git/config present true
cc version Apple clang version 17.0.0 (clang-1700.0.13.3)
gcc version Apple clang version 17.0.0 (clang-1700.0.13.3)
clang version Apple clang version 17.0.0 (clang-1700.0.13.3)
tcc version tcc version 0.9.28rc 2024-02-05 HEAD@105d70f7 (AArch64 Darwin)
tcc git status thirdparty-macos-arm64 c8df4e27
emcc version N/A
glibc version N/A

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.Option TypeBugs/feature requests, that are related to `?Type`.Status: Awaiting FeedbackBugs/feature requests marked as feedback requested.

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions