View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0031527 | Lazarus | LCL | public | 2017-03-12 20:34 | 2017-09-03 22:11 |
Reporter | Benito van der Zander | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | have not tried |
Status | new | Resolution | reopened | ||
Product Version | 1.7 (SVN) | ||||
Summary | 0031527: var/out winapi parameters: GetCursorPos, GetCaretPos, GetWindowRect | ||||
Description | Many functions in lcl/include/winapih.inc have a var parameter, even though the function only uses it as out parameter, which leads to pointless warnings. E.g. GetWindowRect, GetCursorPos, GetCaretPos | ||||
Tags | No tags attached. | ||||
Fixed in Revision | |||||
LazTarget | - | ||||
Widgetset | |||||
Attached Files |
|
duplicate of | 0029948 | resolved | Ondrej Pokorny | Lazarus | GetTextMetrics() declaration - avoid unneccessary hint |
related to | 0029946 | resolved | Marco van de Voort | FPC | GetTextExtentPoint32W() declaration |
related to | 0032369 | resolved | Ondrej Pokorny | Lazarus | Declare out parameters as out, no var |
|
Please search for existing bug reports before sending new. This will never be changed. See the duplicate bug report for more info. |
|
That makes no sense. Only managed types like strings are finalized. WinAPI records do not contain managed types. |
|
Please use the mailing list for discussion. |
|
There you made a good suggestion in your first comment in regarding looking for duplicates. Now I have found the almost duplicate 0029946. It seems that bug is where the discussion takes place. Probably Lazarus copied those incorrect headers from FPC's windows API unit, where they were incorrect because that unit predates having the out parameter in the language. But the LCL is younger than the RTL. |
|
Unassigning myself. |
|
May I make a suggestion ? This would involve a compiler switch or code change along with a change in code tools. Allow the use of "OUT" as you use the function/Procedure as a form of cast. A Procedure defind as GetSomething(Var I:Integer); used as GetSomething(OUT SomeIneger); The compiler can examine prototype for the use of OUT or VAR, if ether is true, treat the field as OUT or VAR, what ever makes the compiler happy and also have code tools not complain about unassigned variables. This way the coder can place the OUT in there so to inform code tools or compiler that the uninitialized variable does not matter. Just an idea. |
|
There is this concept already. No need for a new suggestion: GetSomething(SomeInteger{%H-}); Or disable the hint type in project options. |
|
Yes, that was a good tip, I just went though a major source code list trying that out. {%H-} just a head of the parameters complaining. I don't think anything else needs to be done here... |
Date Modified | Username | Field | Change |
---|---|---|---|
2017-03-12 20:34 | Benito van der Zander | New Issue | |
2017-03-13 11:28 | Ondrej Pokorny | LazTarget | => - |
2017-03-13 11:28 | Ondrej Pokorny | Note Added: 0098870 | |
2017-03-13 11:28 | Ondrej Pokorny | Relationship added | duplicate of 0029948 |
2017-03-13 11:28 | Ondrej Pokorny | Status | new => resolved |
2017-03-13 11:28 | Ondrej Pokorny | Resolution | open => duplicate |
2017-03-13 11:28 | Ondrej Pokorny | Assigned To | => Ondrej Pokorny |
2017-03-14 00:29 | Benito van der Zander | Note Added: 0098894 | |
2017-03-14 00:29 | Benito van der Zander | Status | resolved => assigned |
2017-03-14 00:29 | Benito van der Zander | Resolution | duplicate => reopened |
2017-03-14 07:26 | Ondrej Pokorny | Note Added: 0098896 | |
2017-03-14 07:26 | Ondrej Pokorny | Status | assigned => resolved |
2017-03-14 07:26 | Ondrej Pokorny | Resolution | reopened => duplicate |
2017-03-16 23:21 | Benito van der Zander | Note Added: 0098952 | |
2017-03-16 23:21 | Benito van der Zander | Status | resolved => assigned |
2017-03-16 23:21 | Benito van der Zander | Resolution | duplicate => reopened |
2017-03-16 23:34 | Ondrej Pokorny | Assigned To | Ondrej Pokorny => |
2017-03-16 23:36 | Ondrej Pokorny | Note Added: 0098953 | |
2017-03-16 23:36 | Ondrej Pokorny | Status | assigned => new |
2017-03-17 08:49 | Juha Manninen | Relationship added | related to 0029946 |
2017-03-18 22:00 | jamie philbrook | Note Added: 0099035 | |
2017-03-18 22:10 | Ondrej Pokorny | Note Added: 0099036 | |
2017-03-19 03:38 | jamie philbrook | Note Added: 0099045 | |
2017-09-03 22:11 | Ondrej Pokorny | Relationship added | related to 0032369 |