projects
/
mono.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix warning.
[mono.git]
/
mcs
/
gmcs
/
driver.cs
diff --git
a/mcs/gmcs/driver.cs
b/mcs/gmcs/driver.cs
index eaea1af2101c1427060d659cbeacd20ef4a9c408..63d95d355c1fca7c30265f44e6ea8c372a90ff5b 100644
(file)
--- a/
mcs/gmcs/driver.cs
+++ b/
mcs/gmcs/driver.cs
@@
-94,7
+94,7
@@
namespace Mono.CSharp
//
// Encoding.
//
//
// Encoding.
//
- static Encoding default
E
ncoding;
+ static Encoding default
_e
ncoding;
static Encoding encoding;
static public void Reset ()
static Encoding encoding;
static public void Reset ()
@@
-109,7
+109,7
@@
namespace Mono.CSharp
win32ResourceFile = win32IconFile = null;
defines = null;
output_file = null;
win32ResourceFile = win32IconFile = null;
defines = null;
output_file = null;
- encoding = default
E
ncoding = null;
+ encoding = default
_e
ncoding = null;
first_source = null;
}
first_source = null;
}
@@
-279,9
+279,11
@@
namespace Mono.CSharp
public static int counter1, counter2;
public static int counter1, counter2;
- public static int Main (string[] args)
+
public static int Main (string[] args)
{
RootContext.Version = LanguageVersion.Default;
{
RootContext.Version = LanguageVersion.Default;
+ Location.InEmacs = Environment.GetEnvironmentVariable ("EMACS") == "t";
+
bool ok = MainDriver (args);
if (ok && Report.Errors == 0) {
bool ok = MainDriver (args);
if (ok && Report.Errors == 0) {
@@
-1305,12
+1307,12
@@
namespace Mono.CSharp
encoding = new UTF8Encoding();
break;
case "reset":
encoding = new UTF8Encoding();
break;
case "reset":
- encoding = default
E
ncoding;
+ encoding = default
_e
ncoding;
break;
default:
try {
encoding = Encoding.GetEncoding (
break;
default:
try {
encoding = Encoding.GetEncoding (
-
Int32.Parse (value));
+ Int32.Parse (value));
} catch {
Report.Error (2016, "Code page `{0}' is invalid or not installed", value);
}
} catch {
Report.Error (2016, "Code page `{0}' is invalid or not installed", value);
}
@@
-1318,11
+1320,15
@@
namespace Mono.CSharp
}
return true;
}
}
return true;
}
- //Report.Error (2007, String.Format ("Unrecognized command-line option: `{0}'", option));
- //Environment.Exit (1);
+
return false;
}
return false;
}
+ static void Error_WrongOption (string option)
+ {
+ Report.Error (2007, "Unrecognized command-line option: `{0}'", option);
+ }
+
static string [] AddArgs (string [] args, string [] extra_args)
{
string [] new_args;
static string [] AddArgs (string [] args, string [] extra_args)
{
string [] new_args;
@@
-1364,12
+1370,12
@@
namespace Mono.CSharp
try {
// Latin1
try {
// Latin1
- default
E
ncoding = Encoding.GetEncoding (28591);
+ default
_e
ncoding = Encoding.GetEncoding (28591);
} catch (Exception) {
// iso-8859-1
} catch (Exception) {
// iso-8859-1
- default
E
ncoding = Encoding.GetEncoding (1252);
+ default
_e
ncoding = Encoding.GetEncoding (1252);
}
}
- encoding = default
E
ncoding;
+ encoding = default
_e
ncoding;
references = new ArrayList ();
soft_references = new ArrayList ();
references = new ArrayList ();
soft_references = new ArrayList ();
@@
-1433,10
+1439,19
@@
namespace Mono.CSharp
string csc_opt = "/" + arg.Substring (1);
if (CSCParseOption (csc_opt, ref args, ref i))
continue;
string csc_opt = "/" + arg.Substring (1);
if (CSCParseOption (csc_opt, ref args, ref i))
continue;
+
+ Error_WrongOption (arg);
+ return false;
} else {
} else {
- if (arg
.StartsWith ("/")
){
+ if (arg
[0] == '/'
){
if (CSCParseOption (arg, ref args, ref i))
continue;
if (CSCParseOption (arg, ref args, ref i))
continue;
+
+ // Need to skip `/home/test.cs' however /test.cs is considered as error
+ if (arg.Length < 2 || arg.IndexOf ('/', 2) == -1) {
+ Error_WrongOption (arg);
+ return false;
+ }
}
}
}
}
}
}
@@
-1608,7
+1623,6
@@
namespace Mono.CSharp
if (CodeGen.Assembly.IsClsCompliant) {
AttributeTester.VerifyModulesClsCompliance ();
TypeManager.LoadAllImportedTypes ();
if (CodeGen.Assembly.IsClsCompliant) {
AttributeTester.VerifyModulesClsCompliance ();
TypeManager.LoadAllImportedTypes ();
- AttributeTester.VerifyTopLevelNameClsCompliance ();
}
}
if (Report.Errors > 0)
}
}
if (Report.Errors > 0)
@@
-1650,7
+1664,7
@@
namespace Mono.CSharp
if (ep == null) {
if (RootContext.MainClass != null) {
if (ep == null) {
if (RootContext.MainClass != null) {
- DeclSpace main_cont = RootContext.Tree.GetDecl (MemberName.FromDotted (RootContext.MainClass));
+ DeclSpace main_cont = RootContext.Tree.GetDecl (MemberName.FromDotted (RootContext.MainClass
, Location.Null
));
if (main_cont == null) {
Report.Error (1555, "Could not find `{0}' specified for Main method", RootContext.MainClass);
return false;
if (main_cont == null) {
Report.Error (1555, "Could not find `{0}' specified for Main method", RootContext.MainClass);
return false;