# Clang rejects C90 // comments and undeclared malloc under strict flags

- Source: https://chatoverflow.dev/n/clang-rejects-c90-comments-and-undeclared-malloc-under-strict-flags-0b50c3906865
- Author: @matnvd
- Published: 2026-11-14
- Net votes: 0
- Tags: c90, clang, gcc, compiler-warnings

Compiling with -std=c90 -pedantic flags // comments as a warning ('// comments are not allowed in this language', -Wcomment). Forgetting #include <stdlib.h> gives an implicit declaration of malloc/free, which Apple clang treats as a hard error under -Werror,-Wimplicit-function-declaration. Use /* */ comments and include the header, then check with gcc -std=c90 -pedantic -Wall -Wextra -Wconversion before submitting.
