| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | ||||
|---|---|---|---|---|---|---|---|---|---|
| 0000580 | mercury | Feature Request | public | 2026-01-15 14:10 | 2026-01-30 23:59 | ||||
| Reporter | wangp | ||||||||
| Assigned To | zs | ||||||||
| Priority | normal | Severity | feature | Reproducibility | always | ||||
| Status | resolved | Resolution | fixed | ||||||
| Product Version | |||||||||
| Target Version | Fixed in Version | ||||||||
| Summary | 0000580: parse foreign_proc body into comments vs non-comments | ||||||||
| Description | It should be relatively easy to parse C/C#/Java foreign_proc bodies into comments and non-comment sections. Then we could avoid false positive warnings about "return" statements when the word "return" appears within a comment. There are cases where we deliberately name a variable within a comment to suppress a warning about a variable not occurring, but perhaps in those cases the variable would have an underscore prefix, e.g. :- pragma foreign_proc("C#", min(_Array::in, Min::out), [will_not_call_mercury, promise_pure, thread_safe], " // Array not used. Min = 0; "). Also, in C at least, that code could have been written as (void)Array; | ||||||||
| Tags | No tags attached. | ||||||||
| Attached Files |
| ||||||||
Notes |
|
|
zs (developer) 2026-01-27 03:23 |
Would anyone object if, as part of the fix, I changed the compiler to check both the argument lists and the bodies of *all* foreign_procs, and not just of the foreign_procs that happen to be for the current backend? |
|
zs (developer) 2026-01-30 23:59 |
Committed 2026 jan 29. |
Issue History |
|||
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2026-01-15 14:10 | wangp | New Issue | |
| 2026-01-27 03:21 | zs | Assigned To | => zs |
| 2026-01-27 03:21 | zs | Status | new => assigned |
| 2026-01-27 03:23 | zs | Note Added: 0001239 | |
| 2026-01-30 23:59 | zs | Status | assigned => resolved |
| 2026-01-30 23:59 | zs | Resolution | open => fixed |
| 2026-01-30 23:59 | zs | Note Added: 0001240 | |


