Skip to content

Align minipal header doc comments - #138227

Merged
jkotas merged 7 commits into
dotnet:mainfrom
am11:chore/minipal-header-comments
Nov 26, 2026
Merged

jkotas merged 7 commits into
dotnet:mainfrom
am11:chore/minipal-header-comments

Conversation

@am11

@am11 am11 commented Nov 24, 2026

Copy link
Copy Markdown
Member

Use the prevailing /** */ style with @param and @return for the function declarations in the minipal headers that used // comments or left them out, keeping the existing wording. No code changes.

Use the prevailing `/** */` style with `@param` and `@return` for the function
declarations in the minipal headers that used `//` comments or left them out,
keeping the existing wording. No code changes.
@github-actions github-actions Bot added the area-PAL-coreclr only for closed issues label Nov 24, 2026
@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Nov 24, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
12 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The logging return-value contract needs platform-specific qualification because Android failures can return zero or partial byte counts, not only negative values.

1 open issue
What changed in this PR

This PR standardizes documentation in the runtime’s minipal native portability headers. Function implementations remain unchanged; the diff also includes documentation clarifications and several header-guard renames.

Changes:

  • Convert declaration comments to /** */ blocks with @param and @return tags.
  • Clarify existing platform behavior and API contracts.
  • Normalize header guards and closing comments.
File Description
src/​native/​minipal/​xoshiro128pp.h Clarify zero-seed handling and normalize the closing comment.
src/​native/​minipal/​utf8.h Correct UTF terminology and document supported conversion flags.
src/​native/​minipal/​time.h Standardize timer, sleep, and yield documentation.
src/​native/​minipal/​thread.h Clarify thread-name truncation and WASI process IDs.
src/​native/​minipal/​strings.h Normalize string documentation and the closing comment.
src/​native/​minipal/​rwlock.h Add parameter and return documentation for read-write locks.
src/​native/​minipal/​random.h Document random-buffer parameters and return values.
src/​native/​minipal/​ospagesize.h Convert page-size documentation to block format.
src/​native/​minipal/​mutex.h Standardize mutex operation documentation.
src/​native/​minipal/​memorybarrierprocesswide.h Document memory-barrier operations and rename the header guard.
src/​native/​minipal/​log.h Document logging destinations, parameters, and return contracts.
src/​native/​minipal/​guid.h Normalize the header-guard name.
src/​native/​minipal/​environ.h Standardize environment-variable parameters and return contracts.
src/​native/​minipal/​entrypoints.h Document entry-point lookup.
src/​native/​minipal/​descriptorlimit.h Document descriptor-limit behavior and platform exceptions.
src/​native/​minipal/​debugger.h Normalize the header-guard name.
src/​native/​minipal/​cpuid.h Add the closing header-guard comment.
src/​native/​minipal/​cpufeatures.h Document CPU feature detection and Rosetta detection.
src/​native/​minipal/​cpucount.h Standardize CPU-count documentation.
src/​native/​minipal/​conditionvariable.h Standardize condition-variable documentation and rename the guard.
src/​native/​minipal/​cgroup.h Standardize cgroup documentation and clarify platform scope.

Review effort: Balanced

Comment thread src/native/minipal/log.h Resolved
am11 and others added 2 commits November 24, 2026 23:36
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@am11

am11 commented Nov 24, 2026

Copy link
Copy Markdown
Member Author

@jkotas, @jkoritzinsky, @AaronRobinsonMSFT, this synchronizes doc comments to doxygen style (which we used in the initial days of minipal).

@jkotas

jkotas commented Nov 25, 2026

Copy link
Copy Markdown
Member

If we want to unify the style in some parts of the codebase, should we just reuse the JIT C/C++ formatting style & tooling?

@am11

am11 commented Nov 25, 2026

Copy link
Copy Markdown
Member Author

We started off with doxygen then diverged in recent headers, PR's just aligning it back.

@jkotas jkotas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ok

@jkotas

jkotas commented Nov 25, 2026

Copy link
Copy Markdown
Member

/ba-g build analysis is stuck

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The Doxygen blocks in src/native/minipal/log.h incorrectly document the severity macros and parameters they do not accept, so they need to be moved immediately before the corresponding function declarations.

No open issues 🎉

1 previously missed issue

In code that hasn't changed since last review

Low severity Move Doxygen blocks to the corresponding function declarations

src/​native/​minipal/​log.h:39

These Doxygen blocks precede the severity macros, so they document those macros rather than the functions and describe parameters the macros do not accept. Move each block below its convenience macros, immediately before the corresponding function declaration. The same issue affects minipal_log_vprint, minipal_log_flush, minipal_log_write, and minipal_log_sync at lines 42, 57, 73, and 86.

1 resolved since last review

Review effort: Balanced

Comment thread src/native/minipal/thread.h Resolved
Comment thread src/native/minipal/cpufeatures.h Resolved
Comment thread src/native/minipal/log.h Resolved
- Drop the WASI note from minipal_get_current_process_id.
- Document minipal_log_write/sync as async-signal-safe instead of saying
  how they are implemented.
- Put the log.h doc comments right before the functions, after the
  convenience macros.
- Separate declarations with blank lines.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jkotas
jkotas merged commit e923614 into dotnet:main Nov 26, 2026
110 checks passed
@am11
am11 deleted the chore/minipal-header-comments branch November 26, 2026 01:44
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-PAL-coreclr only for closed issues community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants