Skip to content

[auto-pr] #156: [Coding Guideline]: Subset Guideline for CERT C, INT34-C: Do not shift an expression by a negative number of bits or by greater than or equal to the number of bits that exist in the operand#180

Merged
PLeVasseur merged 3 commits into
mainfrom
guideline-156
Nov 19, 2025
Merged

[auto-pr] #156: [Coding Guideline]: Subset Guideline for CERT C, INT34-C: Do not shift an expression by a negative number of bits or by greater than or equal to the number of bits that exist in the operand#180
PLeVasseur merged 3 commits into
mainfrom
guideline-156

Conversation

@scrc-cg-pr-from-issue

Copy link
Copy Markdown
Contributor

This PR was automatically generated from issue #156.

Authored by: @felix91gr

Closes #156.

@netlify

netlify Bot commented Aug 23, 2025

Copy link
Copy Markdown

Deploy Preview for scrc-coding-guidelines ready!

Name Link
🔨 Latest commit 82fe0d5
🔍 Latest deploy log https://app.netlify.com/projects/scrc-coding-guidelines/deploys/691b440d0111670008d2b02d
😎 Deploy Preview https://deploy-preview-180--scrc-coding-guidelines.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@PLeVasseur

Copy link
Copy Markdown
Collaborator

@felix91gr -- could you add the new tags you're using in another PR?

Note that this fails:

3:49:45 PM: /opt/build/repo/src/coding-guidelines/expressions.rst:334: WARNING: Need could not be created: Tags {'maintainability', 'portability', 'surprising-behavior'} not in 'needs_tags'. [needs.create_need]

@felix91gr

Copy link
Copy Markdown
Collaborator

@PLeVasseur ohh! I see. The Form for creating a New Guideline Issue didn't mention that new tags needed to be added before using them. That's a bit of Contributor Experience we could improve in the Form

image

I'll be adding the new tags right away :)

Comment thread src/coding-guidelines/expressions.rst Outdated
@felix91gr

Copy link
Copy Markdown
Collaborator

GEH. The FLS spec file got us again! Hahahah. Okay, brb, will open a PR to update it.

@felix91gr

Copy link
Copy Markdown
Collaborator

@x0rw I'll need your help again QwQ

It seems like the table in the original issue (same for #181's original issue) isn't being picked up quite how sphinx would want it. Do you know what I should do?

The table looks like this:

  | **Compilation Mode** | **`0 <= M < N`** | **`M < 0`**         |     **`N <= M`**    |
  |:--------------------:|:----------------:|:---------------------:|:-------------------:|
  | Debug                | Shifts normally  | Panics              | Panics              |
  | Release              | Shifts normally  | Shifts by `M mod N` | Shifts by `M mod N` |

@felix91gr

Copy link
Copy Markdown
Collaborator

I've fixed the table manually.

There's a typo that CI complains about; #206 fixes it

@felix91gr felix91gr added coding guideline An issue related to a suggestion for a coding guideline chapter: expressions decidability: decidable A coding guideline which can be checked automatically category: required A coding guideline with category required labels Oct 4, 2025
@felix91gr
felix91gr force-pushed the guideline-156 branch 2 times, most recently from bc2f62c to 9d35d71 Compare October 7, 2025 16:24
@felix91gr
felix91gr requested a review from PLeVasseur October 7, 2025 16:25

@PLeVasseur PLeVasseur left a comment

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.

Good to see this working with the manual table.

Content-wise this is good.

There's a couple of formatting snags I pointed out.

Comment thread src/coding-guidelines/expressions.rst
Comment thread src/coding-guidelines/expressions.rst
@PLeVasseur

Copy link
Copy Markdown
Collaborator

Opened #212 to track to resolution so that we can get this build to pass.

@PLeVasseur

Copy link
Copy Markdown
Collaborator

@felix91gr -- please rebase and push. Build should work now

@felix91gr

Copy link
Copy Markdown
Collaborator

(I just posted this same message in #181)

@PLeVasseur I just did the rebase and push. For some reason, Netlify is still trying to build the document with Python 3.14 🤔

felix91gr and others added 2 commits November 17, 2025 12:31
Co-authored-by: felix91gr <felix91gr@users.noreply.github.com>

Note: tables were written by hand due to limitations in our automation
Note: this must be addressed at the automation level,
since said code blocks were generated from a GH issue
@felix91gr

Copy link
Copy Markdown
Collaborator

I've rebased these changes (even though they shouldn't need to be in this case) so that Netlify can stop building it with Python 3.14. I think all should be well

felix91gr added a commit that referenced this pull request Nov 17, 2025
Note: this must be addressed at the automation level,
since said hyperlinks were generated from a GH issue
Note: this must be addressed at the automation level,
since said hyperlinks were generated from a GH issue
@felix91gr

Copy link
Copy Markdown
Collaborator

@PLeVasseur I've made it work (also found another bug in the markdown->rst conversion; I've just filed it in #221).

I believe this PR is all good now.

There's the last review you made, which if I recall correctly was about extra indentation being present? It has been addressed for a while now, unless it was about something else. I really wish git was able to retain the ID and date of a commit even if it was rebased on top of other, yet independent, commits. It would let me check if I made the second commit in this PR in response to that review or not.

Anywho, let's merge this one? I still have to rebase #181, but I've left it alone for now. Since this one and #181 touch the same file, I'm sure I'd better rebase #181 after the commits in this one are part of main.

@felix91gr
felix91gr requested a review from PLeVasseur November 17, 2025 16:23
@PLeVasseur

Copy link
Copy Markdown
Collaborator

I'll take a look! Thanks 🥰

@PLeVasseur PLeVasseur left a comment

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.

Apologies on not having reviewed this after it was updated. LGTM.

@PLeVasseur
PLeVasseur added this pull request to the merge queue Nov 19, 2025
Merged via the queue into main with commit 3dab1e4 Nov 19, 2025
6 checks passed
@PLeVasseur
PLeVasseur deleted the guideline-156 branch November 19, 2025 16:10
@felix91gr felix91gr added the CERT C Issues or coding guidelines directly related to the CERT C Coding Guidelines label Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: required A coding guideline with category required CERT C Issues or coding guidelines directly related to the CERT C Coding Guidelines chapter: expressions coding guideline An issue related to a suggestion for a coding guideline decidability: decidable A coding guideline which can be checked automatically

Projects

None yet

3 participants