Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2013-04

What is {%H-}?

14 messages · 9 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Lubos Pintes

I am seeing this on random places after parameters in function calls. I know about $ directives, so is % something different, or is that meant as a comment?

Reply by email

Mark Morgan Lloyd
to Mattias Gaertner: On Fri, 05 Apr 2013 09:33:20 +0200 http://wiki.freepascal.org/IDE_directives Mattias
Mattias Gaertner wrote 8 lines
On Fri, 05 Apr 2013 09:33:20 +0200 Lubos Pintes wrote: > I am seeing this on random places after parameters in function calls. > I know about $ directives, so is % something different, or is that meant > as a comment? http://wiki.freepascal.org/IDE_directives

Question if I may: does this imply that the FPC error numbers are "graven in stone", i.e. new errors will always be added at the end of the list even if it would make more sense to have them in the middle?

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Florian Klämpfl
to Mark Morgan Lloyd
Mark Morgan Lloyd wrote 14 lines
Mattias Gaertner wrote: > On Fri, 05 Apr 2013 09:33:20 +0200 > Lubos Pintes wrote: > >> I am seeing this on random places after parameters in function calls. >> I know about $ directives, so is % something different, or is that >> meant as a comment? > > http://wiki.freepascal.org/IDE_directives Question if I may: does this imply that the FPC error numbers are "graven in stone", i.e. new errors will always be added at the end of the list even if it would make more sense to have them in the middle?

The list has big enough holes and renumbering is _very_ unlikely.

Reply by email

Mattias Gaertner
to Mark Morgan Lloyd: Question if I may: does this imply that the FPC error numbers are "graven in stone", i.e.…
Show quoted text 17 lines
Mark Morgan Lloyd hat am 5. April 2013 um 10:11 geschrieben: Mattias Gaertner wrote: > On Fri, 05 Apr 2013 09:33:20 +0200 > Lubos Pintes wrote: > >> I am seeing this on random places after parameters in function calls. >> I know about $ directives, so is % something different, or is that meant >> as a comment? > > http://wiki.freepascal.org/IDE_directives Question if I may: does this imply that the FPC error numbers are "graven in stone", i.e. new errors will always be added at the end of the list even if it would make more sense to have them in the middle?

FPC error numbers are graven stone. Although new errors are added all the time and some of them have higher precedence.

This is independent of the IDE directive {%H-}. It only works on the file position given by the compiler.

Newer compilers might warn at different places within an expression, so sometimes you have to add two {%H-}.

Mattias

Reply by email

Alexander Klenin
to Mattias Gaertner
Mattias Gaertner wrote 6 lines
This is independent of the IDE directive {%H-}. It only works on the file position given by the compiler. Newer compilers might warn at different places within an expression, so sometimes you have to add two {%H-}.

I seriously dislike this solution, especially for the most frequent case of unused parameters --
not only it is a hack, it also does not work while compiling from command line. I would much prefer either {$UNUSED var} compiler directive, or, failing that, Unused(var) library call -- similar to what is done in TAChart.

Alexander S. Klenin

Reply by email

Mark Morgan Lloyd
to Florian Klämpfl: The list has big enough holes and renumbering is _very_ unlikely.
Florian Kl?mpfl wrote 15 lines
Am 05.04.2013 10:11, schrieb Mark Morgan Lloyd: > Mattias Gaertner wrote: >> On Fri, 05 Apr 2013 09:33:20 +0200 >> Lubos Pintes wrote: >> >>> I am seeing this on random places after parameters in function calls. >>> I know about $ directives, so is % something different, or is that >>> meant as a comment? >> http://wiki.freepascal.org/IDE_directives > Question if I may: does this imply that the FPC error numbers are > "graven in stone", i.e. new errors will always be added at the end of > the list even if it would make more sense to have them in the middle? > The list has big enough holes and renumbering is _very_ unlikely.

Thanks Florian.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Mark Morgan Lloyd
to Mattias Gaertner: FPC error numbers are graven stone. Although new errors are added all the time and some…
Mattias Gaertner wrote 24 lines
> Mark Morgan Lloyd hat am 5. April 2013 um > 10:11 geschrieben: > > > Mattias Gaertner wrote: >> On Fri, 05 Apr 2013 09:33:20 +0200 >> Lubos Pintes wrote: >> >>> I am seeing this on random places after parameters in function calls. >>> I know about $ directives, so is % something different, or is that meant >>> as a comment? >> http://wiki.freepascal.org/IDE_directives > Question if I may: does this imply that the FPC error numbers are > "graven in stone", i.e. new errors will always be added at the end of > the list even if it would make more sense to have them in the middle? FPC error numbers are graven stone. Although new errors are added all the time and some of them have higher precedence. This is independent of the IDE directive {%H-}. It only works on the file position given by the compiler. Newer compilers might warn at different places within an expression, so sometimes you have to add two {%H-}.

Thanks, detail noted. Also somebody else's

| Quote:
| Hint: You can right click on a hint in the message window and click on | "hide message via directive" to insert the directive automatically.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Henry Vermaak
to Alexander Klenin: On Fri, Apr 5, 2013 at 7:32 PM, Mattias Gaertner I seriously dislike this solution,…
Alexander Klenin wrote 13 lines
On Fri, Apr 5, 2013 at 7:32 PM, Mattias Gaertner wrote: > > This is independent of the IDE directive {%H-}. It only works on the file > position given by the compiler. > > Newer compilers might warn at different places within an expression, so > sometimes you have to add two {%H-}. I seriously dislike this solution, especially for the most frequent case of unused parameters -- not only it is a hack, it also does not work while compiling from command line. I would much prefer either {$UNUSED var} compiler directive, or, failing that,

Agreed, this would be great.

Henry

Reply by email

Sven Barth
to Henry Vermaak
Henry Vermaak wrote 13 lines
On 5 April 2013 10:43, Alexander Klenin wrote: > On Fri, Apr 5, 2013 at 7:32 PM, Mattias Gaertner > wrote: >> This is independent of the IDE directive {%H-}. It only works on the file >> position given by the compiler. >> >> Newer compilers might warn at different places within an expression, so >> sometimes you have to add two {%H-}. > I seriously dislike this solution, especially for the most frequent > case of unused parameters -- > not only it is a hack, it also does not work while compiling from command line. > I would much prefer either {$UNUSED var} compiler directive, or, failing that, Agreed, this would be great.

I know that it is kind of a repetive mantra, but:

Patches are welcome :) [at least it increases the chance that something is implemented]

Though I currently don't know what would be better: a compiler directive or a function with a untyped var/const parameter... (the latter could allow to use the code with Delphi as well as only that function needs to be implemented)

Regards,
Sven

Reply by email

Kostas Michalopoulos
to Alexander Klenin: On Fri, Apr 5, 2013 at 7:32 PM, Mattias Gaertner I seriously dislike this solution,…

You can use this:

{$PUSH}{$WARN 5024 OFF}
// Code where you dont want to get warnings about unused parameters
{$POP}

(you can put the push at the top of the implementation part of a unit and you wont get warnings for the rest of that unit)

Alexander Klenin wrote 26 lines
On Fri, Apr 5, 2013 at 7:32 PM, Mattias Gaertner wrote: > > This is independent of the IDE directive {%H-}. It only works on the file > position given by the compiler. > > Newer compilers might warn at different places within an expression, so > sometimes you have to add two {%H-}. I seriously dislike this solution, especially for the most frequent case of unused parameters -- not only it is a hack, it also does not work while compiling from command line. I would much prefer either {$UNUSED var} compiler directive, or, failing that, Unused(var) library call -- similar to what is done in TAChart. -- Alexander S. Klenin -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20130405/6f81a3c1/attachment.html>

Reply by email

Sven Barth
to Kostas Michalopoulos
Kostas Michalopoulos wrote 11 lines
You can use this: {$PUSH}{$WARN 5024 OFF} // Code where you dont want to get warnings about unused parameters {$POP} (you can put the push at the top of the implementation part of a unit and you wont get warnings for the rest of that unit)

Originally I wanted to suggest this as well, but it does not allow you to specifically select which parameters to ignore. Though this will depend on whether the user wants to generally disable the message or only disable for selected functions or specific parameters...

Regards,
Sven

Reply by email

Alexander Klenin
to Sven Barth
Sven Barth wrote 12 lines
Am 05.04.2013 14:52, schrieb Kostas Michalopoulos: > {$PUSH}{$WARN 5024 OFF} > // Code where you dont want to get warnings about unused parameters > {$POP} > (you can put the push at the top of the implementation part of a unit and > you wont get warnings for the rest of that unit) > Originally I wanted to suggest this as well, but it does not allow you to specifically select which parameters to ignore. Though this will depend on whether the user wants to generally disable the message or only disable for selected functions or specific parameters...

True. It is also much less readable.

Alexander S. Klenin

Reply by email