Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • S stog
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 6
    • Issues 6
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 1
    • Merge requests 1
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Zoggy
  • stog
  • Merge requests
  • !11

fix invalid printf formats

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Zoggy requested to merge damiendoligez:strict-formats into master Sep 10, 2014
  • Overview 1
  • Commits 1
  • Changes 2

Created by: damiendoligez

There are some format strings that are "invalid" in the stog sources.

In general, invalid formats are nonsensical format strings that were accepted in OCaml 4.01.0 and earlier, but whose semantics is unspecified. They are still accepted by the new Printf implementation of OCaml 4.02.0 but in some cases with different semantics, and they will be statically rejected by OCaml 4.03.0.

You can check for them in OCaml 4.02.0 with the flag -strict-formats.

In the case of stog, the behaviour has not changed between 4.01.0 and 4.02.0 but the formats are probably wrong: they have the form "%0x", which means to pad with '0' characters, but does not specify a minimum width (so there will be no padding). This is treated the same as "%x" by the implementations. The patch changes it to "%02x" and "%04x" to add (what I think is) the right padding, but you should review it carefully.

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: damiendoligez:strict-formats