Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2149102

Summary: glibc: Prepare for upstream integration of GCC 8 compatible _Static_assert
Product: Red Hat Enterprise Linux 9 Reporter: Patrick McGehearty <patrick.mcgehearty>
Component: glibcAssignee: Florian Weimer <fweimer>
Status: CLOSED ERRATA QA Contact: Sergey Kolosov <skolosov>
Severity: low Docs Contact:
Priority: unspecified    
Version: 9.1CC: ashankar, codonell, dj, fweimer, markobri, mcermak, mnewsome, pfrankli, sipoyare
Target Milestone: rcKeywords: Bugfix, Patch, Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: glibc-2.34-52.el9 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-09 08:16:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2142974    

Description Patrick McGehearty 2022-11-28 20:15:32 UTC
Description of problem:
Compile warning in C-collate-seq.c due to missing argument.

Version-Release number of selected component (if applicable):
All el9 glibc releases (9.1 and before)

How reproducible:
When building glibc with -Warn=error will fail
when trying to compile locale/C-collate-seq.C
for some more recent releases of gcc.

I don't know how common that combination is in practice.
As the fix is easy to find and implement, more skilled
builders of glibc may simply be applying the fix in their
environment and not reporting the issue.


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:
upstream glibc has a fix. git blame C-collate-seq.C
shows the fix as 
b8c6166b (Florian Weimer  2021-09-06 19:43:37 +0200  58) _Static_assert (sizeof (collseqmb) == 256, "sizeof (collseqmb)");

The full patch is:
- - - - - -
commit b8c6166b1b75036ab3e4127a1c0aacf52ca93651
Author: Florian Weimer <fweimer>
Date:   Mon Sep 6 19:43:37 2021 +0200

    locale: Add missing second argument to _Static_assert in C-collate-seq.c

diff --git a/locale/C-collate-seq.c b/locale/C-collate-seq.c
index 4fb82cb..40b17f4 100644
--- a/locale/C-collate-seq.c
+++ b/locale/C-collate-seq.c
@@ -55,7 +55,7 @@ static const char collseqmb[] =

 /* This table must be 256 bytes in size. We index bytes into the
    table to find the collation sequence.  */
-_Static_assert (sizeof (collseqmb) == 256);
+_Static_assert (sizeof (collseqmb) == 256, "sizeof (collseqmb)");

 static const uint32_t collseqwc[] =
 {
- - - - - -

Comment 1 Florian Weimer 2022-11-29 07:56:18 UTC
Another commit sheds some light on why this might be needed:

commit c9fef4b7d1d0f2dad192c74f06102752247677a9
Author: Florian Weimer <fweimer>
Date:   Fri Sep 10 13:18:36 2021 +0200

    _Static_assert needs two arguments for compatibility with GCC before 9
    
    This macro definition enforces two arguments even with newer compilers
    that accept the single-argument form, too.
    
    Reviewed-by: Carlos O'Donell <carlos>

I'm not sure if we need to support building with GCC 8. Will it help CentOS Stream contributors? Couldn't they use CentOS 9 Stream with the GCC 11 system compiler?

I'm personally more interested in porting to GCC 12 (which presently does not work, either).

Comment 2 Florian Weimer 2022-11-29 09:07:07 UTC
I changed my mind.

I think it's reasonable to expect that commit c9fef4b7d1d0f2dad192c74f06102752247677a9 ("_Static_assert needs two arguments for compatibility with GCC before 9") might be backported eventually to 2.34, to address the GCC 8 compatibility trap the same way we did this for 2.35 and later upstream. So I decided to get ahead of that and just did that myself. This means that we now need to fix this issue downstream before we can sync with the 2.34 upstream branch, and it won't catch us at a later date by surprise.

Comment 3 Florian Weimer 2022-12-02 14:29:58 UTC
Integrated into Fedora as a downstream-specific backport:

Prepare for integration of GCC 8 compatible _Static_assert (#2149102)
<https://src.fedoraproject.org/rpms/glibc/c/3f0e13124e9a875b62b13d19b2b6c8cb2d767d34?branch=f35>

Comment 9 errata-xmlrpc 2023-05-09 08:16:03 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (glibc bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:2481