Skip to content
Andrew Johnson edited this page Feb 24, 2025 · 11 revisions

LM now accepts C code to compile.

Principle of Unchanged

The C Frontend for LM can optionally emit C code as a target. In this case, the C code should be unchanged from the original source file.

Whitespace may be added or removed. Source location information may be added (this can be disabled). Nonstandard behavior may cause changes to the output code.

Nonstandard Behavior

We try to conform to ANSI C standards but there are some places where interoperability with other LM code yields some non-standard behavior.

  • C Code that compiles with a major C compiler should compile with LM
  • C Code can call out to other LM functions
  • C Code that calls LM functions can potentially use "punned" symbols which need to be mangled
Clone this wiki locally