Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 906018

Summary: x11-libs/gtk+-2.24.33-r2: gdkalias.h:12:5: warning: macro expansion producing 'defined' has undefined behavior [-Wexpansion-to-defined]
Product: Gentoo Linux Reporter: nvinson234
Component: Current packagesAssignee: Gentoo Linux Gnome Desktop Team <gnome>
Status: UNCONFIRMED ---    
Severity: normal Keywords: PATCH
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: cpp_macro_fix.patch

Description nvinson234 2023-05-09 11:57:53 UTC
When building with clang-16, this warning appears many times in the build log. The warning is correct; however, it appears so frequently that it makes finding the actual build error more difficult given the noise.

Reproducible: Always

Steps to Reproduce:
1. Build the library with clang-16
2. Observe the frequent undefined behavior warning messages.
Actual Results:  
Many undefined behavior warning messages appear.

Expected Results:  
Ideally, no warning messages.

The request isn't to fix every warning as gtk+-2 is an essentially dead package. However, removing these warnings could make diagnosing future build failures easier.
Comment 1 nvinson234 2023-05-09 11:59:18 UTC
Created attachment 861386 [details, diff]
cpp_macro_fix.patch

Updates the perl scripts responsible for the noisy undefined error warnings to generate the code in a different manner that prevents the warnings.