wasm4 icon indicating copy to clipboard operation
wasm4 copied to clipboard

C++ template says "Hello from C!"

Open tjpalmer opened this issue 3 years ago • 4 comments

It should say "Hello from C++!" I guess another complication where maybe my idea of auto C++ from C maybe wasn't ideal. But I think it's best to say "C++" here in any case, if it's not too much pain.

tjpalmer avatar Jan 02 '22 03:01 tjpalmer

It could also just say "Hello from C/C++"... not sure we should super over-think this.

joshgoebel avatar Jan 02 '22 03:01 joshgoebel

It might be a good idea to have two templates. One for C and one for C++. The current template favours C quite a bit. If you try to use C++, you have to change the Makefile.

At least that's the last I know of (and I can't test it, since WASI-SDK doesn't provide builds for ARM).

christopher-kleine avatar Jan 02 '22 08:01 christopher-kleine

I'll agree, C and C++ can end up looking quite different, so a template for each would probably be a good idea. I've seen people who are very adamant that you shouldn't say "C/C++" because of that... though I think that's a little over the top.

desttinghim avatar Jan 04 '22 00:01 desttinghim

Besides changing the text, are there any other changes that we would want to make to the C++ template?

The current template favours C quite a bit. If you try to use C++, you have to change the Makefile.

That shouldn't be the case, the C Makefile can handle C++ sources.

aduros avatar Jan 06 '22 14:01 aduros