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

this time strange compiler behavior in separate compilation with several semicolons and characters after #7728

Closed
vicuna opened this issue Feb 17, 2018 · 2 comments

Comments

@vicuna
Copy link

vicuna commented Feb 17, 2018

Original bug ID: 7728
Reporter: vanto
Status: resolved (set by @xavierleroy on 2018-02-17T18:12:57Z)
Resolution: duplicate
Priority: normal
Severity: minor
Version: 4.06.0
Category: compiler driver
Duplicate of: #7727

Bug description

If 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.

@vicuna
Copy link
Author

vicuna commented Feb 17, 2018

Comment author: @xavierleroy

I already explained this to you at #7727#c18880

What's the point of this report?

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

@vicuna vicuna closed this as completed Feb 17, 2018
@vicuna
Copy link
Author

vicuna commented Feb 18, 2018

Comment author: vanto

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.

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