|Anonymous | Login | Signup for a new account||2018-01-21 13:43 CET|
|Main | My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0007526||OCaml||language features||public||2017-05-04 16:01||2017-05-09 16:10|
|Target Version||Fixed in Version|
|Summary||0007526: add (optional) warning on all non-tail calls (unless [@stackcall] attribute is present)|
|Description||The compiler currently support the following warning:|
Warning on non-tail calls if @tailcall present.
I think it would make sense to have another warning which turns the logic around:
give a warning for every non-tail call, unless the user explicitly chooses to suppress the warning (using e.g. an attribute [@stackcall]).
(of course this will be most useful if https://caml.inria.fr/mantis/view.php?id=7525 [^] is fixed too)
Definitely not a "Major" issue. Marking as a feature request.
My opinion is that the proposal is not a great idea. Warnings are supposed to help enforce good coding style and catch potential errors. I don't think that any realistic project will be written in a style where all non-tail calls should be marked explicitly. Non-tail calls are not intrinsically "bad", and are actually very common; having to mark all of them would add too much noise.
So I propose to close the ticket, unless someone feels strongly about it.
Hmm, for all calls it indeed doesn't make sense.
I actually only had recursive calls in mind when I created the ticket.
|Ok, this a bit less extreme, but still, non-tail recursion is the standard way to navigate on recursive data structures. I'm personally not in favor of adding a warning to discourage this style, esp. considering that its specification and implementation would not be straightforward (one needs to distinguish "recursive calls" from others) and would necessary be somehow imperfect (a "recursive" call could be hidden in various ways).|
|2017-05-04 16:01||domsj||New Issue|
|2017-05-04 19:37||gasche||Tag Attached: junior_job|
|2017-05-07 10:29||dra||Status||new => acknowledged|
|2017-05-09 11:51||frisch||Severity||major => feature|
|2017-05-09 11:55||frisch||Note Added: 0017786|
|2017-05-09 14:35||domsj||Note Added: 0017787|
|2017-05-09 16:10||frisch||Note Added: 0017788|
|Copyright © 2000 - 2011 MantisBT Group|