Skip to content

docs: refine pointer conversion guidance - #1227

Open
PLeVasseur wants to merge 4 commits into
mainfrom
docs/fls-provenance-guideline-updates
Open

PLeVasseur wants to merge 4 commits into
mainfrom
docs/fls-provenance-guideline-updates

Conversation

@PLeVasseur

@PLeVasseur PLeVasseur commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • clarify numeric-to-pointer guidance using the current FLS provenance rules
  • remove overlapping rule ownership and isolate each noncompliant example
  • add a focused rule for direct numeric-to-function-pointer transmute
  • define shared matrix coverage semantics and record partial MISRA C R.11.1 coverage

Follow-up to #1225; the FLS lock update landed in #1228.

Checks

  • ./make.py
  • FLS audit: no remaining changes
  • 79 Rust examples and 14 Miri checks passed

@netlify

netlify Bot commented Jul 29, 2026

Copy link
Copy Markdown

Deploy Preview for scrc-coding-guidelines ready!

Name Link
🔨 Latest commit 9513fb3
🔍 Latest deploy log https://app.netlify.com/projects/scrc-coding-guidelines/deploys/6a69ea171a60b20009b35220
😎 Deploy Preview https://deploy-preview-1227--scrc-coding-guidelines.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@PLeVasseur PLeVasseur changed the title docs: align pointer guidance with FLS provenance docs: refine pointer conversion guidance Jul 29, 2026
@PLeVasseur
PLeVasseur force-pushed the docs/fls-provenance-guideline-updates branch from 2902213 to fce2e96 Compare July 29, 2026 11:41
@PLeVasseur
PLeVasseur force-pushed the docs/fls-provenance-guideline-updates branch from fce2e96 to 9513fb3 Compare July 29, 2026 11:55

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Did you look at my PR #426?

I tried to fix some stuff in there, might be useful.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I did not look yet; I should!

Thank you for the link.


#[allow(dead_code)]
fn f1(flag: u32, ptr: * const u32) {
fn f1(flag: usize, ptr: * const u32) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Do you want to mention https://doc.rust-lang.org/std/primitive.pointer.html#method.map_addr-1 as a possible alternative?

**Exception:** ``as`` may be used with ``usize`` as the right operand and an expression of raw pointer
type as the left operand.

An ``as`` cast from a numeric value to a raw pointer type is outside the scope of this guideline; it is

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It leaves an interesting theoretical situation situation where you don't use A numeric value shall not be converted to a pointer but do use this guideline.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants