The GNU Toolchain is a collection of  programming tools produced by the GNU Project. The tools are often packaged together due to their common use for developing software applications, operating systems, and low level software for embedded systems.

This blog is part of a regular series covering the latest changes and improvements in the components that make up this Toolchain.  Apart from the announcement of new releases however, the features described here are at the very bleeding edge of software development in the tools.  This does mean that it may be a while before they make it into production releases, although interested parties can always build their own copies of the toolchain in order to try them out.


New in GCC

Now that GCC 6 is out new features have started to appear in the development sources:

  • The option -Wswitch-unreachable warns whenever a switch statement contains statements between the controlling expression and the first case label, which will never be executed. For example:

    switch (cond)  { i = 15; case 5: <code>

    The option does not warn if the statement(s) between the controlling expression and the first case label are just variable declarations:

    switch (cond) { int i; case 5: <code>

  • A new option -Wno-ignored-attributes disables warnings when an attribute is correctly assigned, but the compiler decides to ignore it anyway.  This is different from the -Wattributes which warns when an attribute is either unknown or used in the wrong place.
  • A new option -Wno-duplicate-decl-specifier has been added to generate warnings whenever a declaration contains duplicate  const, volatile, restrict or _Atomic specifiers. This warning is enabled by -Wall.
  • The option -Wdangling-else warns about constructions where there may be confusion to which if statement an else branch belongs.  For example:

    if (a)
    if (b)
    foo ();
    bar ();

  • The option -Wmemset-elt-size warns about suspicious calls to the memset function, if the first argument references an array, and the third argument is a number equal to the number of elements, but not equal to the size of the array in memory.  For example:

    int array[10];
    memset (array, 0, 10);  // Should be: memset (array, 0, 10 * sizeof (int));


New in GDB

A new point release of GDB is out: 7.11.1. This is a bugfix release addressing a small set of bugs.  In the development GDB sources a couple of new features have been added:

  • Fortran: Support structures with fields of dynamic types and arrays of dynamic types.
  • Rust: GDB now supports debugging programs written in the Rust programming language.

New in the Binutils

Development in the binutils has mostly concentrated on bugfixing, but there have been a few new features added:

  • The ARM port of GAS now has support for the ARMv8-M architecture, including the security and DSP extensions.
  • The ARC port of GAS now accepts .extInstruction, .extCondCode,  .extAuxRegister, and .extCoreRegister pseudo-ops that allow a user to define custom instructions, conditional codes, auxiliary and core registers.
  • The MIPS port of GAS can now generate code for the DSP Release 3 Application Specific Extension.
  • Linker scripts can now use a NOCROSSREFSTO directive. This is like the NOCROSSREFS directive which ensures that two or more output sections are entirely independent from each other, except that it does allow one way referencing. The NOCROSSREFS_TO directive takes a list of output section names and complains if the first section is referenced from any of the other sections.

Closing Notes

That’s it for this report… back in two months time.

Last updated: September 19, 2023