Skip to content

fix(flowc): skip Flow-defined functions shadowing C standard library names - #461

Merged
godofecht merged 1 commit into
mainfrom
work10
Aug 12, 2026
Merged

godofecht merged 1 commit into
mainfrom
work10

Conversation

@godofecht

Copy link
Copy Markdown
Contributor

Summary

Flow source modules like math.flow and memory_simple.flow define stub functions named sin, cos, malloc, calloc, memmove, aligned_alloc with Flow types that differ from the C standard library declarations. The C generator now skips emitting these Flow-defined functions when their name matches a C standard library function, since the included headers already provide the correct prototype.

Also adds aligned_alloc and memmove to the libc skip list.

Test plan

  • Self-host fixed-point passes (byte-identical)
  • Self-compile audit: all compiler/src modules pass
  • Roundtrip: all checks pass
  • math.flow now compiles cleanly
  • memory_simple.flow no longer has malloc/calloc conflicts

This pull request includes code written with the assistance of AI.
The code has not yet been reviewed by a human.

Generated with Devin

…names

Flow source modules like math.flow and memory_simple.flow define stub
functions named sin, cos, malloc, calloc, memmove, aligned_alloc with
Flow types that differ from the C standard library declarations. The
C generator now skips emitting these Flow-defined functions when their
name matches a C standard library function, since the included headers
already provide the correct prototype.

Also adds aligned_alloc and memmove to the libc skip list.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@cursor

cursor Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@godofecht
godofecht merged commit 68e18c7 into main Aug 12, 2026
15 checks passed
@godofecht
godofecht deleted the work10 branch August 12, 2026 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant