GCC Newspaper
OCTOBER 6, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
gcc/include

Parenthesize sdiv_qrnnd macro parameters in longlong.h

Fixes a latent bug in longlong.h by parenthesizing macro parameters to prevent misparsing.

This commit corrects a potential parsing issue in the sdiv_qrnnd macros within longlong.h. Previously, arguments containing commas or assignments could be misparsed due to a lack of parentheses. This fix ensures correct parsing for i370/s390 and VAX architectures, addressing a latent bug that could have led to incorrect behavior. The change mirrors a similar fix in libgcrypt.

In Details

This commit addresses a latent bug in GCC's longlong.h by parenthesizing the n1 and n0 macro parameters in the sdiv_qrnnd macro for the i370/s390 and VAX targets. The absence of parentheses caused misparsing when arguments contained commas or assignments. This fix ensures correct macro expansion, aligning with the fix applied to libgcrypt's version of the macro.

For Context
sdiv_qrnnd
A macro used for signed division and remainder operations on long long integers, likely targeting specific architectures.
longlong.h
A header file in GCC that provides support for 64-bit integers (long long) on various architectures. It often contains architecture-specific implementations and macros.
i370/s390
IBM mainframe processor architectures for which GCC provides support. These are 32-bit architectures.
VAX
A legacy minicomputer architecture developed by Digital Equipment Corporation. GCC has historically supported VAX.
libgcrypt
A free library that provides a set of cryptographic routines used by other applications. It is part of the GNU Project.
Filed Under: gccincludebugfix