C++ standardization was dramatically different in 2020 from earlier years. The business of the International Organization for Standardization (ISO) committee all took place virtually, much like everything else during this pandemic. This article summarizes the C++ standardization proposals before the Core and Evolution Working Groups last year.
Continue reading Report from the virtual ISO C++ meetings in 2020 (core language)
For a multitude of reasons, developers usually compile the project they are working on with only one compiler. On Red Hat Enterprise Linux 8, the system compiler for C and C++ is GNU Compiler Collection (GCC) 8, and newer versions are available through the GCC toolset.
Continue reading Use multiple compilers to build better projects
I recently wrote a few automated database-populating scripts. Specifically, I am running Microsoft SQL Server in a container in a Kubernetes cluster—okay, it’s Red Hat OpenShift, but it’s still Kubernetes. It was all fun and games until I started mixing Windows and Linux; I was developing on my Windows machine, but obviously the container is running Linux. That’s when I got the gem of an error shown in Figure 1. Well, not so much an error as errant output.
Figure 1: Errant output from an SQL statement.
Continue reading “Why Windows and Linux line endings don’t line up (and how to fix it)”
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.
Continue reading Memory error checking in C and C++: Comparing Sanitizers and Valgrind
The first half of this article described dynamic memory allocation in C and C++, along with some of the new GNU Compiler Collection (GCC) 11 features that help you detect errors in dynamic allocation. This second half completes the tour of GCC 11 features in this area and explains where the detection mechanism might report false positives or false negatives.
Continue reading Detecting memory management bugs with GCC 11, Part 2: Deallocation functions
Recently, I’ve been trying to improve the speed of the Clang compiler for C and C++. When I profile the Clang pre-processing step on a large file, one function quickly stands out:
Continue reading Optimizing the Clang compiler’s line-to-offset mapping
The common theme in many time-travel movies is to go back in time to find out what went wrong and fix it. Developers also have that desire to go back in time and find why the code broke and fix it. But, often, that crucial step where everything went wrong happened long ago, and the information is no longer available.
Continue reading Instant replay: Debugging C and C++ programs with rr
OpenMP is an API consisting of compiler directives and library routines for high-level parallelism in C and C++, as well as Fortran. Version 5.1 of OpenMP was released in November 2020 and version 5.0 was released in November 2018. This article discusses the new features from OpenMP 5.0 which are implemented in GCC 11, and some new OpenMP 5.1 features.
Continue reading New features in OpenMP 5.0 and 5.1
The latest versions of Red Hat Software Collections and Red Hat Developer Toolset are available now in beta. Software Collections 3.7 delivers the latest stable versions of many popular open source runtime languages, web servers, and databases natively to the Red Hat Enterprise Linux platform. These components are supported for up to five years, supporting a more consistent, efficient, and reliable developer experience.
Continue reading Red Hat Software Collections 3.7 and Red Hat Developer Toolset 10.1 beta versions now available
This article is the first in a series demonstrating how to use the GNU Debugger (GDB) effectively to debug applications in C and C++. If you have limited or no experience using GDB, this series will teach you how to debug your code more efficiently. If you are already a seasoned professional using GDB, perhaps you will discover something you haven’t seen before.
Continue reading The GDB developer’s GNU Debugger tutorial, Part 1: Getting started with the debugger