Can't turn off [DCC Warning]

Rodbach
Rodbach used Ask the Experts™
on
I have inherited an application which had over 3,000 Hints and Warnings. I have successfully eliminated the majority off these but don't want to touch 3rd party component source code and for these I have been using the {$WARNINGS OFF} compiler directive.

However this won't turn off [DCC Warning] warnings. I have one warning that I don't seem to be able to eliminate and that is

[DCC Warning] JwaWinInet.pas(6390): W1011 Text after final 'END.' - ignored by compiler

which is caused by

{$IFNDEF JWA_OMIT_SECTIONS}
end.
{$ENDIF JWA_OMIT_SECTIONS}

Has anyone any suggestions as to how I can either turn off this warning or change the code to stop it occurring?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Geert GOracle dba
Top Expert 2009
Commented:
delete both compiler directives, just leave the "end."

indicating the end of a unit, is not conditional
Commented:
You would think so but in this case the unit is full of compiler directives and in some circumstances another unit is included which takes care of the end.

Although I grant you it is unusual. However I did discover a way round this. As text after the end of a unit doesn't make a difference I just turned off the compiler warning in the project options.
Geert GOracle dba
Top Expert 2009

Commented:
including another unit
... with uses unitX, unitY

does not end the current unit
no matter what compiler directives you put in

you'll need to give me some prove to convince me otherwise
Geert GOracle dba
Top Expert 2009

Commented:
forget the proof, i found the file > part of the jedi project

how odd can unit programming get when even the header is encompassed with compiler directives
{$IFNDEF JWA_OMIT_SECTIONS}
unit JwaWinInet;
{$ENDIF JWA_OMIT_SECTIONS}

Open in new window


if you actually exclude only 3 compiler directives
the complete unit would give this:
// Some comments
#include "wininet.h"

Open in new window


Way to go Jedi !

Author

Commented:
Deleting the compiler directives around the final end caused some problems as the end was only required depending on which compiler directives were ON. So my solution worked better in these circumstances.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial