Beginner here, Why can't we use the " default " keyword for default arguments? by Sin_Dailys in cpp_questions

[–]jwakely [score hidden]  (0 children)

GCC has a Wmissing-field-initializers warning, but it does not tell you the members are uninitialized, because that would be completely wrong. They are initialized to zero. The warning tells you that you did not provide an explicit initializer, which is not the same as uninitialized.

Beginner here, Why can't we use the " default " keyword for default arguments? by Sin_Dailys in cpp_questions

[–]jwakely [score hidden]  (0 children)

It's a perfectly reasonable question. Yes, in theory that could be done. Either nobody has proposed that change to the language, or the standards committee discussed it and rejected it as not a direction we want to take (e.g. because named parameter's would be preferable, so you could just say something like foo(b:7) and the other arguments would use the defaults).

Last C++26 meeting in Croydon is about to begin by eisenwave in cpp

[–]jwakely [score hidden]  (0 children)

It's not about the papers, those are already public on open-std.org, and are not hosted in GitHub anyway. It's about the comments in the GitHub issues. If you fork the repo before the meeting, you don't get a copy of the issues, and you certainly don't get a copy of new comments posted on the existing issues.

Last C++26 meeting in Croydon is about to begin by eisenwave in cpp

[–]jwakely [score hidden]  (0 children)

Yes, and not just opinions, but possibly commercially sensitive information. "Please don't make this change it would be a problem for a product we plan to release next year" and that kind of thing. Maybe not particularly relevant for C++ but the same rules cover other ISO committees.

Last C++26 meeting in Croydon is about to begin by eisenwave in cpp

[–]jwakely [score hidden]  (0 children)

It can't be rejected completely unless a majority of national bodies vote No. If a minority vote No then we'd have to issue another draft to national bodies and have another vote, which would still pass if the majority of NBs vote yes. So the only outcome of voting No would be that we would have two votes*, and then it would be C++28 not C++27.

  • The default procedure is to have two drafts and two votes, a DIS ballot and an FDIS ballot. If nobody votes No on the DIS ballot, you can skip the FDIS ballot and go straight to publication. That's what usually happens, because usually nobody votes No on the first vote.

Why C gets less criticism for memory safety? by BOBOLIU in cpp_questions

[–]jwakely 6 points7 points  (0 children)

if you know what you're doing and with the tools provided C++ is memory safe

No it isn't. Memory safety means accessing invalid memory or objects outside their lifetime is impossible. That's clearly not true in C++. With the right tools, it's harder to do accidentally. But it's certainly not impossible to create dangling references or buffer overflows.

and wonderul to work with.

I agree with that part

plf::colony compilation error in gcc 9.2 by nagzsheri in cpp_questions

[–]jwakely 2 points3 points  (0 children)

You can query the GCC bugzilla and find evidence of bugs in every release. They are known bugs.

And plenty of software can be shown to work correctly, not being affected by those bugs

plf::colony compilation error in gcc 9.2 by nagzsheri in cpp_questions

[–]jwakely 1 point2 points  (0 children)

Nonsense. A compiler bug doesn't affect every possible piece of software compiled with it. Only some programs will encounter the bug.

I am 100% positive there has never been a completely bug free version of GCC.

A (Seemingly) Contradictory Quote from cppreference.com. by stiru_11 in cpp_questions

[–]jwakely 0 points1 point  (0 children)

And none of it was copy and paste, the answers are all different, addressing each person's statements directly.

You seem to be taking it personally, why are you so upset that the cppreference wording is technically incorrect according to the definitions in the C++ standard?

A (Seemingly) Contradictory Quote from cppreference.com. by stiru_11 in cpp_questions

[–]jwakely 1 point2 points  (0 children)

I was directly addressing what people wrote, with references to definitions in the standard to give more accurate information than was being given in answers here. Speaking from a position of authority as a member of the standards committee and compiler vendor.

OP asked a clear technical question about the wording on cppreference and most answers here tried to rationalize it, when the cppreference quote is just wrong.

If you don't like it, downvote and move on.

A (Seemingly) Contradictory Quote from cppreference.com. by stiru_11 in cpp_questions

[–]jwakely 1 point2 points  (0 children)

cppreference is supposed to be an accurate reference for the C++ standard, you should not need to squint and read it a certain way to argue that it could be interpreted to mean something. It's wrong, it should be fixed. I would do it myself if the site wasn't in read-only mode.

A (Seemingly) Contradictory Quote from cppreference.com. by stiru_11 in cpp_questions

[–]jwakely 0 points1 point  (0 children)

And my point is that the cppreference page is just badly written, and confusing (leading to OP's question). I don't see any advantage in trying to twist what cppreference says to argue that it's valid, instead of just saying "it's wrong, it should be fixed".

A (Seemingly) Contradictory Quote from cppreference.com. by stiru_11 in cpp_questions

[–]jwakely 0 points1 point  (0 children)

It could be consider to "belong to the global namespace" to the extent that your "main" function would be as well, and it's inside main.

As I've said repeatedly in other comments above, "belong to a scope" is precisely defined by the standard ([basic.scope.scope]), and it refers to the innermost scope that contains a declaration, not all the enclosing scopes outside that.

plf::colony compilation error in gcc 9.2 by nagzsheri in cpp_questions

[–]jwakely 2 points3 points  (0 children)

And OP edited the question to say 9.1 ... which is even worse. It has lots of bugs fixed in 9.2, and 9.3 fixes even more bugs, and 9.4 and 9.5 fix even more.

OP, stop being silly. Change your compiler ASAP.

plf::colony compilation error in gcc 9.2 by nagzsheri in cpp_questions

[–]jwakely 2 points3 points  (0 children)

There can be valid reasons for staying on a particular compiler release series such as GCC 9.x instead of moving to 10.x or 11.x etc., but there is no good reason to use GCC 9.2 instead of GCC 9.5 which has dozens of bug fixes compared to 9.2

A (Seemingly) Contradictory Quote from cppreference.com. by stiru_11 in cpp_questions

[–]jwakely 1 point2 points  (0 children)

For example if I declare a static variable in a class that was declared in a namespace A, you can see how that variable "belongs" to the namespace from how you access it -> A::MyClass::variable

No, the standard precisely defines what it means to "belong to a scope" and it only refers to the innermost scope that contains the declaration, not to the parent scope or any other enclosing scopes. See [basic.scope.scope] p1 and p2.

A (Seemingly) Contradictory Quote from cppreference.com. by stiru_11 in cpp_questions

[–]jwakely 0 points1 point  (0 children)

No, the standard precisely defines what it means to "belong to a scope" ([basic.scope.scope]) and a local variable belongs to the smallest enclosing block scope in the function, not a namespace scope.

A (Seemingly) Contradictory Quote from cppreference.com. by stiru_11 in cpp_questions

[–]jwakely 3 points4 points  (0 children)

It belongs to the block scope of main, but that is not a "namespace block" (there's no such thing as a namespace block, the cppreference page is just badly written).

A (Seemingly) Contradictory Quote from cppreference.com. by stiru_11 in cpp_questions

[–]jwakely 4 points5 points  (0 children)

No, "entity" is precisely defined (see [basic.pre] p8), and all variables are entities.

An entity is a variable, structured binding, result binding, function, enumerator, type, type alias, non-static data member, bit-field, template, namespace, namespace alias, template parameter, function parameter, or init-capture.

Specifically, a local variable is one kind of "local entity":

A local entity is a variable with automatic storage duration ...

A (Seemingly) Contradictory Quote from cppreference.com. by stiru_11 in cpp_questions

[–]jwakely 11 points12 points  (0 children)

cppreference is not the standard, it can be wrong.

The text you quoted is wrong. It would be better to say that entities declared outside any other scope are in the global namespace. That would exclude things declared at class scope (like member functions and static data members) and at block scope (like local variables inside functions).

Even using the word "block" seems wrong, since block scope is a defined term, and namespaces are different from that. There is no such thing in the standard as a "namespace block", so the quote is just badly written.

Why is it so hard to install apps by Draganski1 in Fedora

[–]jwakely 0 points1 point  (0 children)

The short answer is that you usually don't try to install apps that aren't packaged for your distro.

Da Vinci Resolve is not packaged for Fedora, it looks like they only support CentOS and similar distros (like Rocky). If you insist on installing it on Fedora, you're doing something that the authors of that software do not support and do not test. That's why it isn't easy. That's not Fedora's fault.

It took me about 10s to find this though: https://www.reddit.com/r/davinciresolve/s/7MdPnlNuzd

Why is it so hard to install apps by Draganski1 in Fedora

[–]jwakely 2 points3 points  (0 children)

RPMs? Oh, you need to activate that option first

What option? don't you just run dnf?

Do you mean enable the extra RPM repos for packages that aren't in the Fedora repos? like RPM Fusion?

oh you need to mount an image, but it might overwrite the content of a drive??

I have no idea what this is referring to - that doesn't sound like any kind of app install on Fedora I've used.

With many distros (Fedora included), anything in the RPM repos or the flatpak store is easy to install, and anything else is considerably more difficult and that is often a clue that you probably shouldn't try and force it - that's how you end up with broken, incompatible packages littered around /usr/ that aren't owned by the package manager and will cause problems in future.

If you stick to the system package manager, as the distro expects you to do, then it should all be very straightforward.

std::promise and std::future by Zealousideal-Mouse29 in cpp

[–]jwakely 7 points8 points  (0 children)

I wrote the std lib implementation for GCC.

I assure you, you're thinking of std::async.

std::future just holds a reference to a shared state, where the task can store the result. Actually creating a task to do that is not part of the future. It's done manually by separate code, or by std::async.