Russell Whitaker wrote:
Adriaan van Os wrote:
The following compiler directives seem to work in GPC
{$W unused} {$W unused-function} {$W unused-value} {$W unused-parameter} {$W unused-label} {$W unused-variable} {$W unused-function}
but there negatives don't
{$W no-unused} {$W no-unused-function} {$W no-unused-value} {$W no-unused-parameter} {$W no-unused-label} {$W no-unused-variable} {$W no-unused-function}
Unless I am doing something wrong (section 6.9 of the gpc manual), this seems to be an omission in gpc.
Haven't read the section. However, would you really want a warning message that says "you don't have an error"?
No, see the equivalent command-line flags, e.g. -Wno-unused-parameter means "don't issue a warning for unused parameters". I didn't invent the naming convention, but is generally used with gpc and gcc..
The idea is to use this locally:
{$W no-unused-parameter} procedure .... {$W unused-parameter}
Ideally, this would also work:
{$local -W no-unused-parameter} procedure .... {$endlocal}
This is better, as {$endlocal} resets the state of the warning to its previous value (whatever the value was).
Regards,
Adriaan van Os