Delphi has a $WARN compiler directive that allows one to selectively enable or disable specific warnings. The Delphi 2009 help file describes the syntax:
{$WARN identifier ON|OFF}
But it only lists the identifiers for 6 warnings.
I’d like to have a complete list of all the warning identifiers. In particular, I want to know the identifiers for the implicit string cast warnings W1057 and W1058 in Delphi 2009.
I managed to guess the one for implicit Ansi->Unicode casts (W1057):
{$WARN IMPLICIT_STRING_CAST OFF}
Googling for that found me the other one:
{$WARN IMPLICIT_STRING_CAST_LOSS OFF}
Though that solves my immediate need, I’d still like to know the complete list of warning identifiers. Stuff like this should be documented.
I looked through the help and didn’t see a full list…so poking around the code it appears the compiler warning constants are all listed in: CodeGear\RAD Studio\6.0\sources\toolsapi\DCCStrs.pas
Search for ‘Implicit_String_Cast_Loss’ and you’ll see the constant sIMPLICIT_STRING_CAST_LOSS = ‘DCC_IMPLICIT_STRING_CAST_LOSS’;
I would assume the rest of the DCC_xxx strings with corresponding X_true/_false/_error defines are what you are after.
Online help hasn’t been very good since Delphi 7.