Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007526OCamllanguage featurespublic2017-05-04 16:012017-05-09 16:10
Reporterdomsj 
Assigned To 
PrioritynormalSeverityfeatureReproducibilityN/A
StatusacknowledgedResolutionopen 
PlatformOSOS Version
Product Version4.03.0 
Target VersionFixed in Version 
Summary0007526: add (optional) warning on all non-tail calls (unless [@stackcall] attribute is present)
DescriptionThe compiler currently support the following warning:

51
    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)
Tagsjunior_job
Attached Files

- Relationships

-  Notes
(0017786)
frisch (developer)
2017-05-09 11:55

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.
(0017787)
domsj (reporter)
2017-05-09 14:35

Hmm, for all calls it indeed doesn't make sense.
I actually only had recursive calls in mind when I created the ticket.
(0017788)
frisch (developer)
2017-05-09 16:10

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

- Issue History
Date Modified Username Field Change
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
Powered by Mantis Bugtracker