GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — added `TokenList` constructors with modern buffer wrappers and hide "unsafe" ones - if available by firewave · Pull Request #496 · cppcheck-opensource/simplecpp

Conversation

@firewave

@firewave firewave commented Aug 15, 2025

Copy link
Copy Markdown
Collaborator

No description provided.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@firewave

firewave commented Aug 15, 2025

Copy link
Copy Markdown
Collaborator Author

Supersedes #377.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@firewave firewave changed the title provide safe API for TokenList only provide "safe" API for TokenList out-of-the-box Aug 15, 2025
@firewave firewave changed the title only provide "safe" API for TokenList out-of-the-box make it possible to hide "unsafe" TokenList API Aug 15, 2025
@firewave
firewave force-pushed the unsafe-api branch 4 times, most recently from 333f2dd to 8313678 Compare August 15, 2025 15:13
@firewave firewave changed the title make it possible to hide "unsafe" TokenList API added TokenList constructor with modern buffer wrappers and made it possible to hide "unsafe" ones Aug 15, 2025
@firewave
firewave force-pushed the unsafe-api branch 7 times, most recently from 4229d04 to ea3a026 Compare August 15, 2025 21:56
@firewave firewave mentioned this pull request Aug 19, 2025
pass a char buffer to simplecpp instead of a stream cppcheck-opensource/cppcheck#6379
Merged
@firewave

firewave commented Aug 19, 2025

Copy link
Copy Markdown
Collaborator Author

This came up in a discussion in cppcheck-opensource/cppcheck#6379.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@firewave
firewave force-pushed the unsafe-api branch from ea3a026 to e78e91c Compare August 19, 2025 07:23
@firewave

firewave commented Aug 19, 2025

Copy link
Copy Markdown
Collaborator Author

The added test is only to make sure it compiles. I will leverage #261 so it will actually be used for the input.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@firewave
firewave force-pushed the unsafe-api branch 2 times, most recently from ddc8da8 to ae24823 Compare August 19, 2025 07:33
@firewave

firewave commented Aug 19, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator Author

Not sure about the SIMPLECPP_UNSAFE_API name. The new constructors are just use modern wrappers and the user can still misuse them like the existing ones. Maybe SIMPLECPP_ENABLE_PTR_CTORS?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@firewave
firewave force-pushed the unsafe-api branch from ae24823 to cd07cec Compare August 19, 2025 08:15
@firewave

firewave commented Aug 19, 2025

Copy link
Copy Markdown
Collaborator Author

We could also add an overload with std::vector<char> so there's also a safer alternative for older standards.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@firewave
firewave marked this pull request as ready for review August 21, 2025 12:46
@firewave

firewave commented Aug 21, 2025

Copy link
Copy Markdown
Collaborator Author

Not sure about the SIMPLECPP_UNSAFE_API name. The new constructors are just use modern wrappers and the user can still misuse them like the existing ones. Maybe SIMPLECPP_ENABLE_PTR_CTORS?

Or SIMPLECPP_LEGACY_API?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

danmar
danmar approved these changes Aug 28, 2025
View reviewed changes
firewave added 3 commits August 28, 2025 22:23
@firewave
added constructors with modern buffer wrappers to TokenList and mad…
02af994
…e it possible to hide "unsafe" ones
@firewave
use feature-test macros
1aeef68
@firewave
test.cpp: added compilation test for safe api
5207325
firewave added 2 commits August 28, 2025 22:23
@firewave
added TokenList constructors for buffers which do not require a siz…
809b624
…e argument
@firewave
renamed SIMPLECPP_UNSAFE_API to SIMPLECPP_TOKENLIST_ALLOW_PTR
24fe556
@firewave
firewave force-pushed the unsafe-api branch from a6615d4 to 24fe556 Compare August 28, 2025 20:28
@firewave

firewave commented Aug 28, 2025

Copy link
Copy Markdown
Collaborator Author

I renamed the define to SIMPLECPP_TOKENLIST_ALLOW_PTR.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@firewave
do not spill SIMPLECPP_TOKENLIST_ALLOW_PTR define
deeb23a
@firewave firewave mentioned this pull request Aug 29, 2025
Safety: Make the interface safer by removing old style C buffer inputs #377
Closed
@firewave firewave changed the title added TokenList constructor with modern buffer wrappers and made it possible to hide "unsafe" ones added TokenList constructors with modern buffer wrappers and made it possible to hide "unsafe" ones Aug 29, 2025
@firewave firewave changed the title added TokenList constructors with modern buffer wrappers and made it possible to hide "unsafe" ones added TokenList constructors with modern buffer wrappers and hide "unsafe" ones - if available Aug 29, 2025
danmar
danmar reviewed Aug 29, 2025
View reviewed changes
Comment thread simplecpp.h Resolved

Uh oh!

There was an error while loading. Please reload this page.

danmar
danmar approved these changes Aug 29, 2025
View reviewed changes
@firewave
firewave merged commit 4056cd5 into cppcheck-opensource:master Aug 29, 2025
@firewave
firewave deleted the unsafe-api branch August 29, 2025 11:59
@jcfr jcfr mentioned this pull request Aug 30, 2025
vendor(simplecpp): Update simplecpp.{h,cpp} to master (37fa4f4); was master (538c5c4) MeVisLab/pythonqt#284
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@danmar danmar danmar approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@firewave @danmar
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.