Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • sac2c sac2c
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 393
    • Issues 393
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 24
    • Merge requests 24
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • sac-group
  • sac2csac2c
  • Merge requests
  • !361

Add #pragma safe

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Quinten Cabo requested to merge Quinten/sac2c:pragma-safe into develop Feb 28, 2025
  • Overview 2
  • Commits 18
  • Changes 20

Add a #pragma safe. The programmer can add #pragma safe to function application expressions. #pragma safe causes type pattern checks on function applications to be skipped by renaming calls to wrapper functions with direct calls to implementation functions. The bypasses the pre- and post- conditions but everything still works out.

As a shortcut you can also put #pragma safe behind blocks. This flags every function application inside the block as safe. You can also put #pragma safe at the start of a files. This will flag every function body block as safe. A shortcut for the block shortcut.

Read much more about this and see examples about #pragma safe on the wiki.

This merge request also cleans up general pragma parsing to use the handle_pragma function now everywhere pragma are parsed.

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: pragma-safe