This patch implements the -gnatw.d switch to activate tagging of warning messages. With this switch set, warning messages will have a tag at the end which is one of: [-gnatw?] ? in a .. z [-gnatw.?] ? in a .. z [enabled by default] So, similar to the tags emitted by GCC for other languages. The patch enables the general mechanism (using new insertion tags ?? and ?x?). So far only a few messages have been tagged, but eventually we will tag as many warning messages as possible. The following source program is compiled with -gnatj.p.d -gnatj70: 1. function warndoc (a, b, c : integer) return integer is 2. x : string := %abc%; | >>> warning: use of "%" is an obsolescent feature (RM J.2(4)), use """ instead [-gnatwj] 3. begin 4. if b > 0 then | >>> warning: "return" statement missing following this statement, Program_Error may be raised at run time [enabled by default] 5. return warndoc (b, a, c); | >>> warning: actuals for this call may be in wrong order [-gnatw.p] 6. end if; 7. end; Tested on x86_64-pc-linux-gnu, committed on trunk 2013-01-02 Robert Dewar * err_vars.ads (Warning_Doc_Switch): New flag. * errout.adb (Error_Msg_Internal): Implement new warning flag doc tag stuff (Set_Msg_Insertion_Warning): New procedure. * errout.ads: Document new insertion sequences ?? ?x? ?.x? * erroutc.adb (Output_Msg_Text): Handle ?? and ?x? warning doc tag stuff. * erroutc.ads (Warning_Msg_Char): New variable. (Warn_Chr): New field in error message object. * errutil.adb (Error_Msg): Set Warn_Chr in error message object. * sem_ch13.adb: Minor reformatting. * warnsw.adb: Add handling for -gnatw.d and -gnatw.D (Warning_Doc_Switch). * warnsw.ads: Add handling of -gnatw.d/.D switches (warning doc tag).