micropython / micropython/micropython

Using clang-cl on Windows

Open
#6,464 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

port-windows
Dominant language
C
Stars
22.1k
Forks
9k
Avg merge
6d 4h
Merged PRs (30d)
16

Description

I see that the sources have some tests in __clang__. But building with clang-cl (the MSVC-driver = clang --driver-mode=cl)
seems unsupported. E.g. on trying to compile examples/embedding/hello-embed.c:

examples/embedding/hello-embed.c(68,6): error: conflicting types for 'mp_import_stat'
uint mp_import_stat(const char *path) {
     ^
.\py/lexer.h(194,18): note: previous declaration is here
mp_import_stat_t mp_import_stat(const char *path);
                 ^

Casting an enum mp_import_stat_t to an uint. What's going on?
I've never thought that was legal.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the clang-cl build failure with examples/embedding/hello-embed.c and compare its mp_import_stat definition with the declaration in py/lexer.h. Review the existing clang tests and determine what is needed for the sources to compile cleanly with clang-cl; done means the reported conflicting-types error is resolved and relevant tests pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.