C++

Red Hat Developer
Article

How to install Clang/LLVM 5 and GCC 7 on RHEL

Rob Terzi

Clang tools and newer versions of GCC can be quite helpful for better warnings and error messages during C/C++ development. This article shows how you can easily install the latest supported Clang 5 and GCC 7 compilers using yum on Red Hat Enterprise Linux. It also provides tips for working with software collections.

Featured image for: Report from the virtual ISO C++ meetings in 2020 (core language).
Article

June 2018 ISO C++ Meeting Trip Report (Core Language)

Jason Merrill

At the summer 2018 ISO C++ standards committee meeting, proposals for new features for C++2a were coming quickly from the Evolution Working Group. Red Hatters covered core, library, and parallelism/concurrency. Read about the new C++ core language features that were accepted at this meeting.

GNU C library
Article

Detecting String Truncation with GCC 8

Martin Sebor

To detect common programming errors, GCC 8 contains a number of new warnings and enhancements to existing checkers to help find non-obvious bugs in C and C++ code. This article focuses on those that deal with inadvertent string truncation and discusses some of the approaches to avoiding the underlying problems.

RHEL
Article

Announcing GA for latest Software Collections, Developer Toolset, Compilers

Mike Guerette

We are pleased to announce the general availability of: Red Hat Software Collections 3.1 (Ruby 2.5, Perl 2.26, PHP 7.0.27, PostgreSQL 10, MongoDB 3.6, Varnish 5, HAProxy 1.8, Apache 2.4 update) Red Hat Developer Toolset 7.1 (GCC 7.3) Clang/LLVM 5.0, Go 1.8.7, Rust 1.25.0

Featured image for: Report from the virtual ISO C++ meetings in 2020 (core language).
Article

March 2018 ISO C++ Meeting Trip Report (Core Language)

Jason Merrill

Following is a trip report from the March 2018 ISO C++ Meeting (Core Language) held in Jacksonville, Florida. This meeting was mostly about new features for C++20, particularly when and how to merge Technical Specifications into the draft standard. 

GNU C library
Article

GNU Toolchain Update - Spring 2018

Nick Clifton

This blog is part of a series covering the latest changes and improvements in the Spring 2018 GNU Toolchain Update and components that make up this Toolchain. Apart from the announcement of new releases, however, the features described here are at the bleeding edge of software development in the tools.

GNU C library
Article

Recommended compiler and linker flags for GCC

Florian Weimer

This article walks through a list of recommended build flags for when you compile your C or C++ programs with GCC. Do you know which build flags you need to specify in order to obtain the same level of security hardening that GNU/Linux distributions such as Fedora and Red Hat Enterprise Linux use?

GNU C library
Article

Usability improvements in GCC 8

David Malcolm

This article summarizes work that was done to make GCC 8 more usable by providing easier to understand warning and error messages. Many of these improvements will help you quickly recognize those common silly mistakes.

Featured image for: Report from the virtual ISO C++ meetings in 2020 (core language).
Article

Red Hat at the ISO C++ Standards Meeting (November 2017): Parallelism and Concurrency

Torvald Riegel

Several Red Hat engineers attended the JTC1/SC22/WG21 C++ Standards Committee meetings in November 2017. This post focuses on the sessions of SG1, the study group on parallelism and concurrency. SG1 had a full schedule as usual, with Executors, Futures, and deferred reclamation mechanisms (e.g., RCU) being major discussion topics. We also started to track the state of proposals and topics we will need to discuss in a publicly accessible bug tracker. I have argued in the past that SG1 should...

Article Thumbnail
Article

The GDB Python API

Phil Muldoon

GDB has evolved in the last several years to provide a Python API. This series of articles will look at how a user can program GDB with the API and will also take an in-depth look at several features of that API. But, before we begin, a small history lesson is needed and a look at just why an API was needed. Why an API? The humble debugger. We've all used one at some point in our careers, sometimes with...

RedHat
Article

Red Hat at the ISO C++ Standards Meeting (July 2017): Parallelism and Concurrency

Torvald Riegel

Several Red Hat engineers attended the JTC1/SC22/WG21 C++ Standards Committee meetings in July 2017. This post focuses on the sessions of SG1, the study group on parallelism and concurrency. We discussed several synchronization-related proposals, improvements for futures, and, of course, executors. Also, I proposed a few steps that the SG1 community could take to get more efficient in how it conducts its work, which are all inspired by how successful open source projects work. Most of the proposals we discussed...

GNU C library
Article

Statement Frontier Notes and Location Views

Alexandre Oliva

Surely, you too have been frustrated, while single-stepping optimized programs in symbolic debuggers, by the Brownian motion in the source code, and by never being sure, when you reach a certain source line (if you can reach it at all), whether or not earlier lines have taken effect. Our frustration is about to be significantly alleviated, thanks to two new pieces of technology about to be contributed to the GNU toolchain. Statement Frontier Notes are stable markers of source locations...

Featured image for: Report from the virtual ISO C++ meetings in 2020 (core language).
Article

Red Hat at the ISO C++ Standards Meetings (November 2016, Issaquah, and February 2017, Kona): Library

Jonathan Wakely

I attended the recent Issaquah and Kona ISO C++ standards meetings, representing Red Hat and the GCC project, and helping to complete the C++17 standard. As usual, I spent the majority of my time in the Library Working Group (LWG) sessions, but also took part in a subgroup focusing on the Filesystem library, more on that below. Following the National Body (NB) ballot on the C++17 draft, the LWG had a huge number of comments to process. Some issues were...

Red Hat ISO Image
Article

Red Hat at the ISO C++ Standards Meeting (April 2017, Kona): Core Language

Jason Merrill

The March/April C++ meeting was back in Kona, Hawaii again, only a year and a half after the last Kona meeting. As usual, Red Hat sent three of us to the meeting: Jonathan Wakely, Torvald Riegel, and me. The headline from the meeting was voting to submit C++17 for approval by the national bodies. There wasn't really any significant resistance. There was one new feature added in the final draft, namely std::byte , which was expected to go in at...

Featured image for: Report from the virtual ISO C++ meetings in 2020 (core language).
Article

Red Hat at the ISO C++ Standards Meeting (March 2017): Parallelism and Concurrency

Torvald Riegel

Several Red Hat engineers attended the JTC1/SC22/WG21 C++ Standards Committee meetings in March 2017. This post focuses on the sessions of SG1, the study group on parallelism and concurrency. The major topics of work of the week were (1) further polishing of the parallel algorithms in the C++17 draft, (2) making progress on the executors proposal (which provides mechanisms to control how parallel work is executed, for example on which resources), and (3) continuing work on proposals targeting the Concurrency...

Red Hat Enterprise Linux
Article

Running HPC workloads across multiple architectures with Red Hat Enterprise Linux

Adrian Reber

In this article, I want to provide some background details about our recently developed demonstration video - “ Running Game of Life across multiple architectures with Red Hat Enterprise Linux “. This video shows the Game of Life running in a heterogeneous environment using three 64-bit hardware architectures: aarch64 (ARM v8-A), ppc64le (IBM Power little endian) and x86_64 (Intel Xeon). If you are not familiar with the rules of this cellular automaton, they are worth checking out via the reference...

Containers Image
Article

Why I started using containers

Konrad Kleine

A few years back (2013-2016) I was working as a C++ Software Development Engineer at Intel on a monolithic product with a backend written in C++ and a web frontend written in Java. The product was shipped complete with hardware and as a VMware image. Internally we kept ISO CD images on a shared server for every released or QA approved version of the product. Built into the product was a very clever issue reporting mechanism that allowed us, developers...

Configuring mKahaDB persistence storage for ActiveMQ
Article

Now available - Red Hat Software Collections 2.4 and Red Hat Developer Toolset 6.1

Mike Guerette

Today, we are announcing the general availability of Red Hat Software Collections 2.4, Red Hat’s latest set of open source web development tools, dynamic languages, and databases. We are also announcing Red Hat Developer Toolset 6.1, which helps to streamline application development on Red Hat Enterprise Linux by giving developers access to some of the latest, stable open source C and C++ compilers and complementary development tools. New language additions to Red Hat Software Collections 2.4 include: Nginx 1.10 Node.js...

Red Hat Logo
Article

C/C++ library upgrades and opaque data types in process shared memory

Carlos O'Donell

The problem C/C++ libraries expect to be able to change the internal implementation details of opaque data types from release to release since such a change has no external ABI consequences. If an opaque data type is placed in process-shared memory (when allowed by the standard) and shared with multiple processes, each process must ensure they are using exactly the same version of the library or they could fail in unexpected ways during library upgrades. The placement of opaque data...

Red Hat Wimplicit
Article

-Wimplicit-fallthrough in GCC 7

Marek Polacek

(See this article to install GCC 7 on Red Hat Enterprise Linux.) In C and C++, the cases of a switch statement are in fact labels, and the switch is essentially a go to that jumps to the desired label. Since labels do not change the flow of control, one case block falls through to the following case block, unless terminated by a return , a break , a no return call or similar. In the example below, " case...

Fedora logo
Article

ABI change analysis of Fedora packages

Dodji Seketeli

In 2016, many improvements happened in the ABI static analysis framework that is Libabigail . In this article we'll present how fedabipkgdiff , a new Libabigail tool can help Fedora users, developers and others to analyze ABI changes of libraries carried by packages of the distribution. Introduction As many of you already know, the engine used to build RPM packages in the Fedora build system is named Koji . Thus, one can get Fedora RPMs from Koji using a web...

GNU C library
Article

Memory Error Detection Using GCC

Martin Sebor

Introduction GCC has a rich set of features designed to help detect many kinds of programming errors. Of particular interest are those that corrupt the memory of a running program and, in some cases, makes it vulnerable to security threats. Since 2006, GCC has provided a solution to detect and prevent a subset of buffer overflows in C and C++ programs. Although it is based on compiler technology, it's best known under the name Fortify Source derived from the synonymous...

GNU C library
Article

Testing... Testing... GCC

David Malcolm

The next release of the GNU Compiler Collection , GCC 7 , is fast approaching, so in this post, I'm going to talk about work I've done to make GCC more reliable GCC has a large test suite: when I test a patch, roughly 330,000 tests are run, covering various aspects of the compiler, such as: handling valid and invalid syntax in the front-ends verifying that optimizations passes are run verifying that the resulting code runs correctly verifying that the...

GNU C library
Article

Adding buffer overflow detection to string functions

Florian Weimer

This article describes the steps required to add buffer overflow protection to string functions. As a real-world example, we use the strlcpy function, which is implemented in the libbsd library on some GNU/Linux systems. This kind of buffer overflow protection uses a GNU Compiler Collection (GCC) feature for array size tracking (“source fortification”), accessed through the __builtin_object_size GCC built-in function. In general, these checks are added in a size-checking wrapper function around the original (wrapped) function, which is strlcpy in...