C & C++

977 readers
14 users here now

founded 5 years ago
MODERATORS
1
 
 

Like every major GCC release, this version will bring many additions, improvements, bug fixes, and new features. GCC 15 is already the system compiler in Fedora 42. Red Hat Enterprise Linux (RHEL) users will get GCC 15 in the Red Hat GCC Toolset. It's also possible to try GCC 15 on Compiler Explorer and similar pages.

This article describes only new features implemented in the C++ front end; it does not discuss developments in the C++ language itself.

The default dialect in GCC 15 is still -std=gnu++17. You can use the -std=c++23 or -std=gnu++23 command-line options to enable C++23 features, and similarly for C++26 and others.

2
 
 

Using the -j option is ignored. About two weeks ago I found out that cmake was compiling with only one thread but everything was ok a couple of months ago. I'm using Debian Trixie which is still in testing so I thought it was a bug, but after many system updates I didn't saw cmake being updated. I couldn't find anything after a some searches. Another related issue is that I recently compiled a new version of a qt app with an edit box to set the number of threads for running LLMs, after the last compilation it doesn't allow to set more than one. Any clue?

3
 
 

cross-posted from: https://lemmy.ml/post/28413957

I work at Red Hat on GCC, the GNU Compiler Collection. I spent most of the past year working on how GCC emits diagnostics (errors and warnings) in the hope of making it easier to use. Let's take a look at 6 improvements to look forward to in the upcoming GCC 15.

  1. Prettier execution paths
  2. A new look for C++ template errors
  3. Machine-readable diagnostics
  4. An easier transition to C23
  5. A revamped color scheme
  6. libgdiagnostics
4
 
 

cross-posted from: https://lemmy.ml/post/28018658

Qt 6.9 is here! This release brings exciting innovations, enhanced graphics performance, and new platform capabilities to help you build exceptional applications.

Highlighted improvements in Qt 6.9 include:

  • Qt Graphs: Interactive 2D panning, zooming, and dynamic 3D graph injection. Printing support now available!
  • Qt Quick: GPU-accelerated SVG animations and Variable Rate Shading for improved graphics performance.
  • Qt Quick Controls: New context menu support enhances desktop integration and user experience.
  • XR Enhancements: Haptic feedback added for creating richter immersive virtual interactions.
5
 
 

With P2900, we propose to add contract assertions to the C++ language. This proposal is in the final stages of wording review before being included in the draft Standard for C++26. It has been suggested by some members of the C++ standard committee that this feature is too large, too complicated, and hard to teach. As it turns out, the opposite is true: contract assertions are actually very simple and can be explained in just five minutes. In this blog post, we will do exactly this!

As the name says, contract assertions are assertions — correctness checks that the programmer can add to their code to detect bugs at runtime. So they’re just like the existing assert macro, except they’re not macros (which fixes a bunch of problems) and they’re way more flexible and powerful!

6
 
 

Boost provides free peer-reviewed portable C++ source libraries that work well with the C++ Standard Library. Boost libraries are intended to be widely useful, and usable across a broad spectrum of applications. The Boost license encourages the use of Boost libraries for all users with minimal restrictions.

In Boost 1.87.0 a new library was added:

  • Parser: Framework for building parsers
7
 
 

KDE Frameworks are 72 addon libraries to Qt which provide a wide variety of commonly needed functionality in mature, peer reviewed and well tested libraries with friendly licensing terms. For an introduction see the KDE Frameworks release announcement.

8
 
 

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.

9
 
 

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.

10
 
 

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.

11
 
 

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 @[email protected]

12
 
 

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:

  1. “Zero annotation is required by default, because existing C++ source code already contains sufficient information”
  2. “We should not require a safe function annotation”
  3. “Do not add a feature that requires viral annotation”
  4. “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.

13
 
 

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.

14
1
submitted 6 months ago* (last edited 6 months ago) by [email protected] to c/[email protected]
 
 

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

15
 
 

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.

https://pvs-studio.com/en/blog/video/11127/?utm%5C_source=website&utm%5C_medium=mastodon&utm%5C_campaign=podcast&utm%5C_content=ccpcast

@cpp

16
 
 

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.

17
18
19
20
21
 
 
22
 
 

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?

23
24
 
 

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.

25
 
 
view more: next ›