[libc-commits] [libc] libc: Remove `extern "C"` from main declarations (PR #102825)

David Blaikie via libc-commits libc-commits at lists.llvm.org
Mon Aug 12 12:58:44 PDT 2024


dwblaikie wrote:

> > Yeah - beats me. Hopefulyl someone on libc can look into this, turn off the warning, or whatnot.
> > Maybe one of these files puts "main" in a namespace by accident and the `extern "C"` works around this?
> 
> It's because we compile everything with `-ffreestanding`.

Ah, so maybe all the `main` rules shouldn't apply when building with that mode? it looks like at least `-Wreturn-type` does this (it warns on main-without-return-statement when compiling with `-ffreestanding` but doesn't warn without that flag, so all makes sense)

https://github.com/llvm/llvm-project/pull/102825


More information about the libc-commits mailing list