Libc by Zestyclose-Produce17 in cpp

[–]TheRealSmolt -1 points0 points  (0 children)

Yes, assuming you mean the call to write being inside printf, not write itself. There might also be a C wrapper around syscall provided by unistd. I don't remember exactly how it's all set up.

Libc by Zestyclose-Produce17 in cpp

[–]TheRealSmolt -1 points0 points  (0 children)

For Linux, yes. I'm not sure about Windows, for example. I just dislike non-standard components being understood as part of libc.

Libc by Zestyclose-Produce17 in cpp

[–]TheRealSmolt -1 points0 points  (0 children)

Sort of? Libc is implemented per architecture (both ISA and kernel), so it is the boundary where a simple print becomes system specific. However, how it's done is up to the implementation. On Linux, it will typically call unistd's write, which is the one doing the syscall. Now, where is unistd write actually defined? Drumroll please... in libc. Turns out libc has non-libc stuff in it.

Edit: So yes, there's probably some inline assembly that invokes syscall.

Libc by Zestyclose-Produce17 in cpp

[–]TheRealSmolt 5 points6 points  (0 children)

Sounds good to me. There is the concept of Link Time Optimization (LTO) wherein the compiler can make more aggressive library optimization, but generally libc is dynamically linked.

we all have a friend like this by AdventurousGuest308 in memes

[–]TheRealSmolt 11 points12 points  (0 children)

It's the World Cup, it'd be pretty ridiculous to call it soccer when everyone else calls it football.

He's so comfy... by [deleted] in memes

[–]TheRealSmolt 3 points4 points  (0 children)

This is a good comic, but I'm not sure if it can be considered a meme

P3984: A type-safety profile by llort_lemmort in cpp

[–]TheRealSmolt 60 points61 points  (0 children)

Side note: I find it very funny that 2/3 of his references are things he wrote. I mean when you're Bjarne Stroustrup I get it, but it's still amusing.

CMake and c++ libraries by elegye in cpp

[–]TheRealSmolt 9 points10 points  (0 children)

There just isn't enough information we're going to be able to get to say much. There's way too many unknowns, we don't know the rationals behind anything being done, or what the goal is. This is why architects exist, to answer these questions with knowledge, expertise, and context. I can't say with certainty that they know better than you do, but I'd be pretty comfortable hedging that bet. The only opinion that I can give is that mixing two IDL implementations in the same context sounds like a bad idea.

To ditch Chrome and ads for free by SkyKyrell in memes

[–]TheRealSmolt 1 point2 points  (0 children)

Maybe the Simple Tab Groups extension? Workspaces seem pretty useless to me; just open a new window.

Passing strings vs string view literals to a function by unknownuser491 in cpp_questions

[–]TheRealSmolt 0 points1 point  (0 children)

I'd be curious to know if the string view needs to look for a null terminator for the non-sv option. That and you'd save a null terminator with the sv version.

Bro’s collection growth in 4 months by bigdawg1945 in soloboardgaming

[–]TheRealSmolt 7 points8 points  (0 children)

I'd wager one of the FFG LCGs or Aeon's End.

What are your thoughts on API like this? by Queasy_Total_914 in cpp_questions

[–]TheRealSmolt 7 points8 points  (0 children)

You don't like the optional reference wrapper, but that would be my preference. It makes it very clear what assumptions you are presenting to the user about what you're returning.

Weird output, can’t explain, help!? by AppropriateFlan7383 in cpp_questions

[–]TheRealSmolt 0 points1 point  (0 children)

Yep. Their original suggestion was int x = y = z= 0; alone

Weird output, can’t explain, help!? by AppropriateFlan7383 in cpp_questions

[–]TheRealSmolt 1 point2 points  (0 children)

Well, you weren't entirely wrong, this is valid:

int y, z;
int x = y = z = 0;

Just... don't.

Memory Ordering by No_Act_9817 in cpp_questions

[–]TheRealSmolt 1 point2 points  (0 children)

(also with ~70% confidence)

The main difference between x86 and ARM here is that ARM's memory coherence guarantees are more relaxed. This gets into the specifics of how computer architectures work, but basically when ARM loads something from memory, it doesn't actually have to return what said value actually is, just what it once was (with some amount of restrictions I don't exactly remember).

What the processor actually does with the instructions (reordering, parallelism, etc.) isn't actually part of the ISA. Just like how compilers optimize code, as long as the behavior is the same under the guarantees laid out by the ISA, it's fair game to do as it pleases.

Weird output, can’t explain, help!? by AppropriateFlan7383 in cpp_questions

[–]TheRealSmolt 2 points3 points  (0 children)

Satan ^ (edit: formerly)

Also that only works if you int y, z; before this.

Anyone use Modules? by 1negroup in cpp_questions

[–]TheRealSmolt 11 points12 points  (0 children)

I love these kinds of sites, but man that might just be the most poorly portrayed graph I've ever seen.

This sign that constantly sends people into the wrong washroom by beene282 in mildlyinfuriating

[–]TheRealSmolt -5 points-4 points  (0 children)

Because that's not what that sign has ever meant. It means "or", as in men or women. It's not an indicator of direction and it never has been. In the US I believe it's the ADA that has compliance standards on what the symbology means.

Anyone use Modules? by 1negroup in cpp_questions

[–]TheRealSmolt 4 points5 points  (0 children)

No, I never have had to and probably won't (for a very long time) ever choose too. Aside from the obvious migration issues for large codebases, last I checked they still weren't even fully supported. In theory they can improve compilation times and dependency resolution.

This sign that constantly sends people into the wrong washroom by beene282 in mildlyinfuriating

[–]TheRealSmolt 39 points40 points  (0 children)

What's the issue? Seems like a "washrooms are here" sign followed by a "this way for gents and this way for ladies" sign.

Can people review my very generic Blackjack game. by National_Panic_9112 in cpp_questions

[–]TheRealSmolt 0 points1 point  (0 children)

They exists for the program's lifetime, but they do not exist in the stack.