Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Printf ignores width on %b %c %a %% (and maybe other) #4799

Closed
vicuna opened this issue May 19, 2009 · 3 comments
Closed

Printf ignores width on %b %c %a %% (and maybe other) #4799

vicuna opened this issue May 19, 2009 · 3 comments

Comments

@vicuna
Copy link

vicuna commented May 19, 2009

Original bug ID: 4799
Reporter: till
Status: closed (set by @xavierleroy on 2017-09-24T15:32:08Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 3.11.0
Target version: 4.03.0+dev / +beta1
Category: ~DO NOT USE (was: OCaml general)
Tags: junior_job
Related to: #5949
Monitored by: @hcarty

Bug description

Printf.sprintf "%5c" 'c';;

  • : string = "c"

Seems tricky and not worth it for %a

@vicuna
Copy link
Author

vicuna commented Sep 17, 2012

Comment author: @damiendoligez

We should document this properly without changing the code.

@vicuna
Copy link
Author

vicuna commented Sep 27, 2014

Comment author: @damiendoligez

This will be fixed in 4.03 either by declaring such formats invalid or by implementing the padding (probably the former).

@vicuna
Copy link
Author

vicuna commented Mar 24, 2016

Comment author: @damiendoligez

On 4.03, give the option -strict-formats to the compiler and it signals an error on these formats.

@vicuna vicuna closed this as completed Sep 24, 2017
@vicuna vicuna added this to the 4.03.0 milestone Mar 14, 2019
@vicuna vicuna added the bug label Mar 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant