C & C++
- Contracts for C++ (design by contract) [PDF]
In this paper, we propose a Contracts facility for C++ that has been carefully considered by SG21 with a high bar set for level of consensus. The proposal includes syntax for specifying three kinds of contract assertions: precondition assertions, postcondition assertions, and assertion statements. In addition, we specify four evaluation semantics for these assertions — one non- checking semantic, ignore, and three checking semantics, observe, enforce, and quick_enforce — as well as the ability to specify a user-defined handler for contract violations. The features proposed in this paper allow C++ users to leverage contract assertions in their ecosystems in numerous ways.
- Memory error checking in C and C++: Comparing Sanitizers and Valgrinddevelopers.redhat.com Memory error checking in C and C++: Comparing Sanitizers and Valgrind | Red Hat Developer
Debugging memory errors can be challenging, and having the right tool helps. See how Valgrind and Sanitizers compare for common C and C++ memory errors.
cross-posted from: https://lemmy.ml/post/22262821
> This article compares two tools, Sanitizers and Valgrind, that find memory bugs in programs written in memory-unsafe languages. These two tools work in very different ways. Therefore, while Sanitizers (developed by Google engineers) presents several advantages over Valgrind, each has strengths and weaknesses. Note that the Sanitizers project has a plural name because the suite consists of several tools, which we will explore in this article.
- C++20 comparison in Qt (even with C++17)
In the Qt 6.7 release, we enabled support for C++20 comparison and also back-ported some of its features to C++17. This blog post will give you an overview of the comparison enhancements we are taking advantage of and offer guidance on implementing them in your custom classes.
- Hi there! Thanks everyone who could join us on the previous talk on parsing C++.
Hi there! Thanks everyone who could join us on the previous talk on parsing C++.
I’m happy to announce a new talk!
In this talk on the С++ semantics, we will take a look at symbols and name resolution. We will discuss different kinds of lookups, scope importing, overload resolution, as well as templates and their specifics.
Date: November 06, 2024, 12:00 PM UTC+1
I invite all C++ enthusiasts to join! - https://pvs-studio.com/en/webinar/
@cpp @cppguide @programming\_discussions @cplusplus @cplusplus@allforall.network
- Why Safety Profiles Failed
Safety Profiles were introduced in 2015 with the promise to detect all lifetime safety defects in existing C++ code. It was a bold claim. But after a decade of effort, Profiles failed to produce a specification, reliable implementation or any tangible benefit for C++ safety. The cause of this failure involves a number of mistaken premises at the core of its design:
- “Zero annotation is required by default, because existing C++ source code already contains sufficient information”
- “We should not require a safe function annotation”
- “Do not add a feature that requires viral annotation”
- “Do not add a feature that requires heavy annotation”
The parameters of the problem make success impossible. This paper examines the contradictions in these premises, explains why the design didn’t improve safety in the past and why it won’t improve safety in the future.
- Bjarne Stroustrup: We need better performance testing [PDF]
Does the C++ design follow the zero-overhead principle? Should it? I think it should, even if that principle isn’t trivial to define precisely. Some of you (for some definition of “you”) seem not to. We– WG21 as an organization – haven’t taken it seriously enough to make it a requirement for acceptance of new features. I think that is a serious problem, but one that we (WG21) should be able to handle. This paper offers some examples.
- is anyone on here using cppfront in production?
i've been playing with cppfront for a few minutes now and it's been a surprisingly pleasant experience so far. i'm tempted to try it out at work to see what happens, but i wanna know if anyone tried to use it in production and what your experiences are
for those who haven't heard of it, cppfront is a cpp2 to c++ compiler, a bit like coffeescript for js. cpp2 is herb sutter's proposal of a new and cleaner c++ syntax with better ergonomics, better orthogonality, and better defaults
- PVS-Studio on CppCast: Exploring the World of C++ Parsing and Analysis
PVS-Studio on CppCast: Exploring the World of C++ Parsing and Analysis
Yuri Minaev, the C++ static analyzer architect at PVS-Studio, joins CppCast to talk about static analysis and how PVS-Studio helps develop software.
- New C++ features in GCC 14developers.redhat.com New C++ features in GCC 14 | Red Hat Developer
Discover new features and enhancements in the C++ front end in GCC 14, the next major version of the GNU Compiler Collection.
cross-posted from: https://lemmy.ml/post/15682818
> The next major version of the GNU Compiler Collection (GCC), 14.1, was released on May 7 2024. Like every major GCC release, this version brings many additions, improvements, bug fixes, and new features.
- Lightning Talk: Write Valid C++ and Python in One File - Roth Michaels - CppCon 2023
YouTube Video
Click to view this content.
- Question: Maybe is impossible to make std::begin (and friends) as friend function
Yes, it is probably a weird question, but I tried a lot, and I started to think that maybe is impossible to overload this template function properly:
```cpp #include <iterator>
class Foo { private: const int arr[5] = {10, 20, 30, 40, 50}; public: const int* begin() const { return arr; }
friend auto std::begin<>(const Foo &f) -> decltype(f.begin()); } ```
It always throw the same error (in GCC 12.2.0):
main.cxx:10:13: error: template-id ‘begin<>’ for ‘const int* std::begin<>(const Foo&)’ does not match any template declaration
I just wanna know if is possible do things like this. Thanks.
- WearPico - An open source Smartwatch firmware written in C for the Raspberry Pi Picogithub.com GitHub - umutsevdi/wear-pico: An open source Smartwatch firmware written in C for the Raspberry Pi Pico
An open source Smartwatch firmware written in C for the Raspberry Pi Pico - GitHub - umutsevdi/wear-pico: An open source Smartwatch firmware written in C for the Raspberry Pi Pico
Hi everyone, I built an open-source Smartwatch firmware for Raspberry Pi Pico in C programming language.The watch has the following features:
- Call Management
- Notifications
- Music and media control
- Reminder
- Alarms
- Lock Screen
- Temperature
- Touch Gestures
- Stopwatch
- Calendar
- Notepad
- Remote Configuration
- A Journey Into Non-Virtual Polymorphism in C++ - Rudyard Merriam - CppCon 2023
YouTube Video
Click to view this content.
- ISO C++ Standards Committee Panel Discussion - Hosted by Herb Sutter - CppCon 2023
YouTube Video
Click to view this content.
- Brauzer - A Browser For Geminigithub.com GitHub - umutsevdi/brauzer: A graphical web browser for Linux from scratch in C for a variety of alternative web protocols
A graphical web browser for Linux from scratch in C for a variety of alternative web protocols - GitHub - umutsevdi/brauzer: A graphical web browser for Linux from scratch in C for a variety of al...
Hi everyone I'm writing a web browser for Linux in C programming language. It's a work in progress. It supports HTTP Gemini and Gopher. Check it out. Feel free to contact me for any issues or feature requests.
- Bjarne Stroustrup's Plan for Bringing Safety to C++thenewstack.io Bjarne Stroustrup's Plan for Bringing Safety to C++
At the CppCon C++ conference, the C++ creator identified the specific kinds of safety measures sorely needed in the programming language.
- Set Stack Memory to a value.
I am writing a unit test and mocking library in C and I want to set the call stack memory to some pre determined value like memset. I want to do this before the test function is called so the test writer can verify they aren't using uninitialized memory in their tests. Is there any somewhat portable way to do this?
- open source structured thread safe logging library for C
cross-posted from: https://lemmy.ml/post/4072147
> Is there a library for C, providing thread safe (high performance), and structured logging? An example for rust is the Tracing crate for rust (from Tokio). It should support several outputs as well.
- New C++ features in GCC 13developers.redhat.com New C++ features in GCC 13 | Red Hat Developer
Get an overview of what's new in GCC 13, the latest GNU Compiler Collection release, including bug fixes and new features in the C++ front end.
cross-posted from: https://lemmy.ml/post/1447800
> The latest major version of the GNU Compiler Collection (GCC), 13.1, was released in April 2023. Like every major GCC release, this version brings many additions, improvements, bug fixes, and new features. GCC 13 is already the system compiler in Fedora 38. Red Hat Enterprise Linux (RHEL) users will get GCC 13 in the Red Hat GCC Toolset (RHEL 8 and RHEL 9). It's also possible to try GCC 13 on godbolt.org and similar web pages. > > Like the article I wrote about GCC 10 and GCC 12, this article describes only new features implemented in the C++ front end; it does not discuss developments in the C++ language itself. Interesting changes in the standard C++ library that comes with GCC 13 are described in a separate blog post: New C features in GCC 13
- GitHub - orlp/polymur-hash: The PolymurHash universal hash function.github.com GitHub - orlp/polymur-hash: The PolymurHash universal hash function.
The PolymurHash universal hash function. Contribute to orlp/polymur-hash development by creating an account on GitHub.
- Trip report: Summer ISO C++ Meeting in Varna, Bulgaria by Jonathan Müller
Trip report from the first C++26 ISO meeting by foonathan
- Trip report: Summer ISO C++ standards meeting (Varna, Bulgaria) by Herb Sutterherbsutter.com Trip report: Summer ISO C++ standards meeting (Varna, Bulgaria)
Minutes ago, the ISO C++ committee finished its meeting in-person in Varna, Bulgaria and online via Zoom, where we formally began adopting features into C++26. Our hosts, VMware and Chaos, arranged…
Trip report from the first C++26 ISO meeting
- Can C++ Be Saved? Bjarne Stroustrup on Ensuring Memory Safetythenewstack.io Can C++ Be Saved? Bjarne Stroustrup on Ensuring Memory Safety
C++ creator Bjarne Stroustrup joins calls for changing the programming language itself to address security concerns, though other core contributors want to make more modest moves.
Reddit comments r/computerscience
- GitHub - hanoglu/TermiC: GCC powered interactive C/C++ terminal created with BASHgithub.com GitHub - hanoglu/TermiC: GCC powered interactive C/C++ terminal created with BASH
GCC powered interactive C/C++ terminal created with BASH - GitHub - hanoglu/TermiC: GCC powered interactive C/C++ terminal created with BASH
- Carbon, a new programming language from Google, aims to be C++ successor9to5google.com Carbon, a new programming language from Google, aims to be C++ successor
Carbon, the latest programming language to be built within Google, was unveiled today as an experimental successor to C++.
- Can you Make it Better? Exploring the CMake Debate - Incredibuildwww.incredibuild.com Can you Make it Better? Exploring the CMake Debate - Incredibuild
Let's dive into the CMake controversy, and break down the pluses and minuses of the critical C++ tool.
- Compile-tome Wordle via the C++ template system
Because the world isn't weird enough?
- rotor (c++ actor microframework) v0.19 has been releasedgithub.com GitHub - basiliscos/cpp-rotor: Event loop friendly C++ actor micro-framework, supervisable
Event loop friendly C++ actor micro-framework, supervisable - GitHub - basiliscos/cpp-rotor: Event loop friendly C++ actor micro-framework, supervisable
- What are some good resources to learn C++?
I don't know I feel like there aren't many resources to learn C++. Maybe it is because I am not looking hard enough. Can someone here recommend some websites or videos?
- rotor v0.16 released with improved performanc (c++ actor framework)github.com GitHub - basiliscos/cpp-rotor: Event loop friendly C++ actor micro-framework, supervisable
Event loop friendly C++ actor micro-framework, supervisable - GitHub - basiliscos/cpp-rotor: Event loop friendly C++ actor micro-framework, supervisable