Details

int != safe && int != ℤ (whole numbers)

Peter Sommerlad - Better Software
consultant and trainer

Peter Sommerlad is consultant and trainer for Safe Modern C++ and Agile Software Engineering. Peter was professor at and director of IFS Institute for Software at FHO/HSR Rapperswil, Switzerland until February 2020. Peter is co-author of „POSA Vol.1“ and „Security Patterns“ and contributed to other books as well as several ISO standards (C, C++, vulnerabilities) and C++ guidelines. Peter is a member of MISRA-C++, Hillside, ACM, IEEE Computer Society, ACCU, ISO WG23 and the ISO WG21 C++ committee.

Peter Sommerlad
11:30 - 13:00
Vortrag: Fr 4.2

Programming language integers suffer from potential inaccuracy in arithmetic operations as well as undefined behavior in languages like C++ and C.

This talk shows the risks involved in inappropriate integer operations and the problems with implicit type conversion of the original operands types that can confuse programmers. We will also look at a few other languages besides C++ on how they deal with integer arithmetic.

Target Audience: Developers
Prerequisites:Basic knowledge in C or C++, for advanced examples some more C++ is helpful but not essential
Level: Introductory

Extended Abstract:
Programming language integers suffer from potential inaccuracy in arithmetic operations as well as undefined behavior in languages like C++ and C.

This talk shows the risks involved in inappropriate integer operations in C++ and the problems with integral promotion and the "usual arithmetic conversions" that in addition to the original operands types can further confuse programmers. We will also look at a few other languages on how they deal with integer arithmetic.

We will take a look at language safety guidelines with respect to integer arithmetic and operations and see where are their limitations in static analysis.

However, the power of C++ and new standard library features will allow us to implement safer alternatives. It might be a bit of art required to actually achieve syntactical nicety, efficient implementation and well-defined behavior when dealing with whole numbers and integers.

Note: this talk will not include approaches for unlimited precision arithmetic that might be required for some domains.

  • assess the risk of integer arithmetic quiz
  • why are there hidden problems, shouldn't integers just wrap?
  • what safety guidelines say
  • options for dealing with inaccuracy (overflow)
  • C++26: saturation arithmetic
  • convenient, safe, efficient: can we have all 3?

Vortrag Teilen

Embedded-Friendly C++: Features That Make a Difference

C++ is widely used in various fields, particularly in embedded systems where tight constraints are common. Writing software in this domain is both challenging and rewarding.

This talk will cover various library elements and language improvements that enhance embedded software development. We'll explore real-world tasks like converting raw byte blobs into usable data structures.

By the end of this talk, you will know the most important C++ improvements for embedded and similar environments.

Target Audience: C++ Developers
Prerequisites:C++ knowledge
Level: Practicing

Extended Abstract:
C++ is used in many different fields. One that sticks out is the embedded domain, you're often working with tight constraints. Writing software is challenging and fun at the same time.

What has C++ done to support this field? What new options do you have to avoid undefined behavior, write more efficient and robust code?

In this talk, I will present various library elements as well as language improvements that make writing embedded software better.

We'll look at real-world tasks like turning raw byte blobs into usable data structures, aka type punning, of course, without triggering undefined behavior. C++26 supports you in a new way with `std::start_life_time_as`. I'll explore that new library function with you, including solutions for pre C++26.

Transferring data via a network comes with its own challenges. You have to care about the byte order. Oh, and how can you make sure that there are no padding bytes included? Well, I have an answer for you.

By the end of this talk, you know the most important improvements in C++ for embedded or similar environments.

Unique Code GmbH

Andreas Fertig is an expert C++ trainer and consultant who delivers engaging and impactful training sessions, both on-site and remotely, to teams around the globe.

As an active member of the C++ standardization committee, Andreas contributes directly to shaping the future of the language. He shares insights on writing cleaner, more efficient C++ code at international conferences. He publishes specialist articles, e.g., for iX magazine, and has published several C++ textbooks.

With C++ Insights (https://cppinsights.io), Andreas has created an internationally recognized tool that enables users to look behind the scenes of C++ and thus understand constructs even better.

Discover more about Andreas and his work at andreasfertig.com.

Andreas Fertig
11:30 - 13:00
Vortrag: Fr 4.2

Vortrag Teilen