GCC Newspaper
JUNE 15, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
gcc

De-duplicate '#define _GNU_SOURCE' in libgomp/config/linux/allocator.c

The `_GNU_SOURCE` macro is de-duplicated in `libgomp/config/linux/allocator.c`, resolving a minor redundancy.

This commit removes a duplicate #define _GNU_SOURCE directive from libgomp/config/linux/allocator.c. The change is a minor cleanup to remove redundant preprocessor definitions, ensuring the code remains tidy and standard-compliant. It specifically tidies up a small redundancy introduced by a previous commit related to pinned memory on Linux.

In Details

This is a minor build system clean-up for libgomp, specifically impacting libgomp/config/linux/allocator.c. The _GNU_SOURCE macro is a standard preprocessor definition enabling GNU extensions to POSIX. Its duplication, likely introduced during the implementation of pinned memory on Linux, is now resolved by simply removing the redundant definition. This has no functional impact but ensures cleaner code and avoids potential redefinition warnings if compilers were strict about such issues.

For Context

This is a very small, technical cleanup in the compiler's support library for OpenMP, a tool for parallel programming. Inside one of the source code files (allocator.c), there was a line that said #define _GNU_SOURCE twice. This line is a switch that tells the compiler to enable certain features specific to Linux. Having it twice doesn't cause any problems but is redundant. This change simply removes the extra, unnecessary line, making the code slightly cleaner. It won't affect how your programs run.

Filed Under: cleanuplibgomp