2008-11-05 Francisco Figueiredo Jr. <francisco@npgsql.org>
[mono.git] / mcs / mcs / report.cs
index 35bd760f43d4e6535d78dbd719bd77eae0520e84..8122aa13dfb75603ceb91e5c4abbe3815455dcd0 100644 (file)
@@ -102,8 +102,10 @@ namespace Mono.CSharp {
                        3000, 3001, 3002, 3003, 3005, 3006, 3007, 3008, 3009,
                        3010, 3011, 3012, 3013, 3014, 3015, 3016, 3017, 3018, 3019,
                        3021, 3022, 3023, 3026, 3027,
+                       
+                       414,    // Non ISO-1 warnings
 #if GMCS_SOURCE
-                       402, 414, 458, 464, 693, 1058, 1700, 3024
+                       402, 458, 464, 693, 1058, 1700, 3024
 #endif
                };
 
@@ -478,18 +480,6 @@ namespace Mono.CSharp {
                {
                        static string prefix, postfix;
 
-                       [System.Runtime.InteropServices.DllImport ("libc", EntryPoint="isatty")]
-                       extern static int _isatty (int fd);
-                       
-                       static bool isatty (int fd)
-                       {
-                               try {
-                                       return _isatty (fd) == 1;
-                               } catch {
-                                       return false;
-                               }
-                       }
-                       
                        static ErrorMessage ()
                        {
                                string term = Environment.GetEnvironmentVariable ("TERM");
@@ -511,7 +501,7 @@ namespace Mono.CSharp {
                                if (!xterm_colors)
                                        return;
 
-                               if (!(isatty (1) && isatty (2)))
+                               if (!(UnixUtils.isatty (1) && UnixUtils.isatty (2)))
                                        return;
                                
                                string config = Environment.GetEnvironmentVariable ("MCS_COLORS");
@@ -681,8 +671,10 @@ namespace Mono.CSharp {
                                        return;
                                }
 
+                               // FIXME: Completely wrong, it has to use FindMembers
                                MemberCore mc = temp_ds.GetDefinition (mi.Name);
-                               SymbolRelatedToPreviousError (mc);
+                               if (mc != null)
+                                       SymbolRelatedToPreviousError (mc);
                        }
                }
 
@@ -718,7 +710,11 @@ namespace Mono.CSharp {
 
                static void SymbolRelatedToPreviousError (string loc, string symbol)
                {
-                       extra_information.Add (String.Format ("{0} (Location of the symbol related to previous ", loc));
+                       string msg = String.Format ("{0} (Location of the symbol related to previous ", loc);
+                       if (extra_information.Contains (msg))
+                               return;
+
+                       extra_information.Add (msg);
                }
 
                public static void ExtraInformation (Location loc, string msg)