Skip to content

Conversation

@AliceLR
Copy link
Owner

@AliceLR AliceLR commented Jun 25, 2025

Initializing ARCH_CXXFLAGS with ARCH_CFLAGS is potentially harmful, as these variables are almost always initialized with recursive expansion appends. If ARCH_CXXFLAGS is assigned in this manner, adding an option like -std=gnu99 to ARCH_CFLAGS will propagate to ARCH_CXXFLAGS even if it's added to ARCH_CFLAGS after initializing ARCH_CXXFLAGS, causing compiler warnings or errors.

Instead, either initialize ARCH_CFLAGS and ARCH_CXXFLAGS identically (or near-identically), or prefer setting an arch-specific variable like NDS_CFLAGS for common options which can then be appended to both.

See discussion on #571:
#571 (comment)

Initializing ARCH_CXXFLAGS with ARCH_CFLAGS is potentially harmful,
as these variables are almost always initialized with recursive
expansion appends. If ARCH_CXXFLAGS is assigned in this manner,
adding an option like -std=gnu99 to ARCH_CFLAGS will propagate to
ARCH_CXXFLAGS even if it's added to ARCH_CFLAGS after initializing
ARCH_CXXFLAGS, causing compiler warnings or errors.

Instead, either initialize ARCH_CFLAGS and ARCH_CXXFLAGS identically
(or near-identically), or prefer setting an arch-specific variable like
NDS_CFLAGS for common options which can then be appended to both.

See discussion on #571:
#571 (comment)
@AliceLR AliceLR added this to the 2.93e milestone Jun 25, 2025
@AliceLR AliceLR merged commit c39ddc4 into master Jun 28, 2025
18 checks passed
@AliceLR AliceLR deleted the fix-arch-cxxflags branch June 28, 2025 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant