Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007728OCamlcompiler driverpublic2018-02-17 18:552018-02-18 17:44
Reportervanto 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionduplicate 
PlatformOSOS Version
Product Version4.06.0 
Target VersionFixed in Version 
Summary0007728: this time strange compiler behavior in separate compilation with several semicolons and characters after
DescriptionIf a line has three semicolons, there is an error. If it has four semicolons, there is no error. And so on, there is an error for semicolons that are odd number and no error for semicolons that are even number.
example:
let a = 12;; (* OK *)
let a = 12;;; (* error *)
let a = 12;;;; (* OK *)
let a = 12;;;;; (* error *)
... and so on.
Likewise,
let a = 12;;12 (* Error: This expression has type int
       This is not a function; it cannot be applied. *)
let a = 12;;12;; (* OK *)
let a = 12;;12;;; (* Error: Syntax error *)
let a = 12;;12;;;; (* OK *)
... and so on.
This does not seem to disturb the compilation and does not seem to
represent a potential danger.
TagsNo tags attached.
Attached Files

- Relationships
duplicate of 0007727resolved Multiple semicolons at the end of a line with no error mentioned 

-  Notes
(0018883)
xleroy (administrator)
2018-02-17 19:12

I already explained this to you at https://caml.inria.fr/mantis/view.php?id=7727#c18880 [^]

What's the point of this report?

Please, don't be a pain and report actual bugs only.

(0018888)
vanto (viewer)
2018-02-18 17:44

I do not want to be a pain for everyone. The goal was to show that we should not confuse "do nothing" with "no operation" as the NOP mnemonic microprocessors.
I tested about 20000 lines of code, compiled into an executable file, with only two semicolons on each line. At runtime, knowing that the processor power was between up to 3%, in less than a second the file generated a microprocessor power ranging from 50% to more than 70%, and then stabilize around 3%.
A "no operation" (NOP) takes less power. Although it may be useful in certain circumstances, as demonstrated by a developer, it does not mean "do nothing".
I only want to say that in Caml Light this generates an error. Today the syntax of OCaml is no longer the same as Caml Light, this is called the evolution of language. Something else, these two semicolons could become, perhaps, a security problem for the future, and this syntax given to these semicolons seemed to me to become a bug later. Maybe this concept is to be reviewed for improvement?
Sorry if I hurt someone.

- Issue History
Date Modified Username Field Change
2018-02-17 18:55 vanto New Issue
2018-02-17 19:12 xleroy Note Added: 0018883
2018-02-17 19:12 xleroy Status new => resolved
2018-02-17 19:12 xleroy Resolution open => duplicate
2018-02-17 19:13 xleroy Relationship added duplicate of 0007727
2018-02-18 17:44 vanto Note Added: 0018888


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker