Skip to content

Conversation

mdh1418
Copy link
Member

@mdh1418 mdh1418 commented Oct 3, 2025

Fixes #120007

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a folding constant warning in the EventPipe native code by replacing magic numbers with properly defined constants. The changes improve code maintainability by eliminating hardcoded values and making the code more readable.

Key changes:

  • Defines new constants for EventPipe user events configuration
  • Replaces magic numbers with named constants in session management code

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/native/eventpipe/ep-types-forward.h Adds new constant definitions for user events capacity and activity ID extension size
src/native/eventpipe/ep-session.c Replaces magic numbers with the newly defined constants

@mdh1418
Copy link
Member Author

mdh1418 commented Oct 3, 2025

I upgraded my mac m1 to Tahoe 26.0.1 and Xcode 26.0.1 (17A400)

% sw_vers
ProductName: macOS
ProductVersion: 26.0.1
BuildVersion: 25A362

but I can't seem to reproduce the build errors @vcsjones hit in #120007 (comment) from a clean repo.

I think moving those vars to defines should resolve the warnings but as I can't repro the compiler warnings, I couldn't double check.

@mdh1418 mdh1418 force-pushed the fix_user_events_folding_constant_warning branch from ad28043 to 2b1a794 Compare October 3, 2025 19:10
@vcsjones
Copy link
Member

vcsjones commented Oct 3, 2025

Hm. I still see the warnings in the build in main, but they no longer fail the build (did we change how this warning is treated somewhere?)

Anyway, I don't see the warnings in the build with this PR.

Copy link
Member

@lateralusX lateralusX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Putting the constant into a macro or enum should resolve the warning. Reduce the scope and put it directly in the source file instead of the more widely used header.

@lateralusX lateralusX merged commit 0e6124b into dotnet:main Oct 7, 2025
129 checks passed
@mdh1418 mdh1418 deleted the fix_user_events_folding_constant_warning branch October 7, 2025 13:32
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.

Mono compilation fails with Xcode 26 toolchain: gnu-folding-constant

4 participants