Bug: a440 example is not compilable with cosmocc

Author: kapstokCreated Apr 25, 2026Updated May 14, 2026
Labelslow severity

Contact Details

No response

What happened?

I tried to compile examples/a440.c with a fresh download of https://cosmo.zip/pub/cosmocc/cosmocc.zip. I got this error:

c
./a440.c: In function 'main':
./a440.c:58:26: error: 'M_PIf' undeclared (first use in this function); did you mean 'M_PI'?
   58 |       float s = sinf(2 * M_PIf * WAVE_INTERVAL * t);
      |                          ^~~~~
      |                          M_PI
./a440.c:58:26: note: each undeclared identifier is reported only once for each function it appears in

The solution is trivial, but I wanted to make sure I didn't do anything stupid.

Version

cosmocc (GCC) 14.1.0

What operating system are you seeing the problem on?

Linux

Relevant log output

bash