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

compilation incorrecte de Printf.sprintf #3111

Closed
vicuna opened this issue Dec 30, 2001 · 0 comments
Closed

compilation incorrecte de Printf.sprintf #3111

vicuna opened this issue Dec 30, 2001 · 0 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Dec 30, 2001

Original bug ID: 765
Reporter: administrator
Status: closed
Resolution: not a bug
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

Full_Name: David Monniaux
Version: 3.04
OS: Linux/x86 et Solaris/Sparc
Submission from: curie.noos.net (212.198.0.93)

Un de mes anciens programmes est compilé incorrectement par OCaml 3.04:
il contient une fonction
let gen_fconst_label = Printf.sprintf "fconst__%04d";;

Cette fonction se comporte lors de l'exécution du programme comme si
elle avait été écrite:
let gen_fconst_label = Printf.sprintf "%04d";;

[Le programme en question est un petit compilateur.
Les chaînes générées étant des labels dans du code assembleur, ça donne ceci:
0000: .double 0r0.0000000000
0002: .double 0r-1.0000000000
0001: .double 0r1.0000000000 ]

Par contre, si on l'eta-expanse:
et gen_fconst_label x = Printf.sprintf "fconst__%04d" x;;

on obtient le résultat correct.
[fconst__0000: .double 0r0.0000000000
fconst__0002: .double 0r-1.0000000000
fconst__0001: .double 0r1.0000000000]

Je n'arrive pas à reproduire cela sur un exemple plus petit, mais le source
est disponible sur http://www.di.ens.fr/~monniaux/download/laxc.tar.gz
(c'est le module sparc.ml).

Le problème se produit:

  • sur Sparc / Solaris 2.8, OCaml ayant été compilé avec gcc 2.95.2
  • sur x86 / Linux, OCaml ayant été compilé avec gcc 3.0.3
@vicuna vicuna closed this as completed Jan 4, 2002
@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant