@SuperDicq @anhedonia Casting the return value of malloc() makes it sepples-compatible, which appears to be the cursed intention.

@Suiseiseki@freesoftwareextremist.com Oh I don't know anything about C++. What does C++ do differently that it doesn't understand malloc normally?

@SuperDicq main.cpp:5:26: error: invalid conversion from ‘void*’ to ‘int*’ [-fpermissive]
5 | int *yes = malloc(sizeof(int)*4);
| ~~~~~~^~~~~~~~~~~~~~~
| |
| void*

The C++ spec refuses to allow implicit casting even in well formed cases, so you have to either compile with -fpermissive or cast.

@Suiseiseki@freesoftwareextremist.com I keep learning more and more reasons for why nobody should ever use C++ every single day

@GNUxeava@fedi.absturztau.be @Suiseiseki@freesoftwareextremist.com I think it's hilarious that nobody who uses C++ actually understands anything about C++. At least it feels like that to me.

@SuperDicq @Suiseiseki it's true
it tries to be everything so a person only knows parts of c++ they've actually used
what i like about c++ is if you know how to do one thing and be good at it, it will work forever. I miss this soooo much with python because every package in existence complains about major.minor.revision.revision.revision.revision to be different and refuses to work
Follow

@GNUxeava @Suiseiseki @SuperDicq
By now C++ is also several different languages with compatible syntax, I've seen several iterations of its transformation in my lifetime and then I just stopped caring 😂
With the most recent standard it even looks like a decent language, problem is — would everyone on your team be using it, without certain convention set by the project and everyone following it everyone writes their own C++ and it works, but the code turns into mincemeat.

Sign in to participate in the conversation
Librem Social

Librem Social is an opt-in public network. Messages are shared under Creative Commons BY-SA 4.0 license terms. Policy.

Stay safe. Please abide by our code of conduct.

(Source code)

image/svg+xml Librem Chat image/svg+xml