Index: mtype.c
===================================================================
--- mtype.c	(revision 766)
+++ mtype.c	(working copy)
@@ -3418,8 +3418,13 @@
 void TypeSArray::toDecoBuffer(OutBuffer *buf, int flag)
 {
     Type::toDecoBuffer(buf, flag);
-    if (dim)
+#if _MSC_VER
+	if (dim)
+        buf->printf("%Iu", dim->toInteger());
+#else	
+	if (dim)
         buf->printf("%ju", dim->toInteger());
+#endif
     if (next)
         /* Note that static arrays are value types, so
          * for a parameter, propagate the 0x100 to the next
Index: statement.c
===================================================================
--- statement.c	(revision 766)
+++ statement.c	(working copy)
@@ -1875,8 +1875,14 @@
                     case Tdchar:        flag += 2; break;
                     default:            assert(0);
                 }
+				const char *format = 
+#ifdef _MSC_VER
+				"_aApply%s%.*s%Id";
+#else
+				"_aApply%s%.*s%zd";
+#endif
                 const char *r = (op == TOKforeach_reverse) ? "R" : "";
-                int j = sprintf(fdname, "_aApply%s%.*s%zd", r, 2, fntab[flag], dim);
+                int j = sprintf(fdname, format, r, 2, fntab[flag], dim);
                 assert(j < sizeof(fdname));
                 FuncDeclaration *fdapply = FuncDeclaration::genCfunc(Type::tindex, fdname);
 
Index: backend/el.c
===================================================================
--- backend/el.c	(revision 766)
+++ backend/el.c	(working copy)
@@ -3028,7 +3028,7 @@
  */
 
 targ_ldouble el_toldouble(elem *e)
-{   targ_ldouble result;
+{   targ_ldouble result = 0;
 
     elem_debug(e);
     assert(cnst(e));
Index: backend/out.c
===================================================================
--- backend/out.c	(revision 766)
+++ backend/out.c	(working copy)
@@ -1277,6 +1277,7 @@
         blockopt(0);                    /* optimize                     */
     }
 
+#if SCPP
     if (CPP)
     {
         // Look for any blocks that return nothing.
@@ -1302,6 +1303,7 @@
                 func_noreturnvalue();
         }
     }
+#endif
     assert(funcsym_p == sfunc);
     if (eecontext.EEcompile != 1)
     {
Index: backend/os.c
===================================================================
--- backend/os.c	(revision 766)
+++ backend/os.c	(working copy)
@@ -40,7 +40,7 @@
 #include        <windows.h>
 #endif
 
-#if __DMC__ || __GNUC__
+#if __DMC__ || __GNUC__ || _MSC_VER
 static char __file__[] = __FILE__;      /* for tassert.h                */
 #include        "tassert.h"
 #else
@@ -678,7 +678,7 @@
 
 long os_file_size(int fd)
 {
-#if _WIN32
+#if _WIN32 && !defined(_MSC_VER)
     return GetFileSize(_osfhnd[fd],NULL);
 #else
     struct stat buf;
Index: backend/newman.c
===================================================================
--- backend/newman.c	(revision 766)
+++ backend/newman.c	(working copy)
@@ -194,7 +194,7 @@
  * Convert from identifier to operator
  */
 
-#if __GNUC__    // NOT DONE - FIX
+#if __GNUC__ || _MSC_VER   // NOT DONE - FIX
 char * unmangle_pt(const char **s)
 {
     return (char *)*s;
Index: backend/cod4.c
===================================================================
--- backend/cod4.c	(revision 766)
+++ backend/cod4.c	(working copy)
@@ -2938,7 +2938,7 @@
 code *cdport(elem *e,regm_t *pretregs)
 {   regm_t retregs;
     code *c1,*c2,*c3;
-    unsigned char op,port;
+    unsigned char op,port = 0;
     unsigned sz;
     elem *e1;
 
Index: backend/md5.h
===================================================================
--- backend/md5.h	(revision 766)
+++ backend/md5.h	(working copy)
@@ -48,10 +48,18 @@
   unsigned char digest[16];     /* actual digest after MD5Final call */
 } MD5_CTX;
 
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
 void MD5Init (MD5_CTX *mdContext);
 void MD5Update (MD5_CTX *mdContext, unsigned char *inBuf, unsigned inLen);
 void MD5Final (MD5_CTX *mdContext);
 
+#ifdef  __cplusplus
+}
+#endif
+
 /*
  **********************************************************************
  ** End of md5.h                                                     **
Index: backend/cdef.h
===================================================================
--- backend/cdef.h	(revision 766)
+++ backend/cdef.h	(working copy)
@@ -228,7 +228,7 @@
 
 #if __GNUC__
 #define LONGLONG        1
-#elif __SC__ < 0x700 || _MSC_VER
+#elif defined(__SC__) && __SC__ < 0x700
 #define LONGLONG        0
 #else
 #define LONGLONG        1               // add in code to support 64 bit integral types
Index: backend/cgobj.c
===================================================================
--- backend/cgobj.c	(revision 766)
+++ backend/cgobj.c	(working copy)
@@ -1141,7 +1141,7 @@
 STATIC void obj_defaultlib()
 {
     char library[4];            // default library
-    static const char model[MEMMODELS] = "SMCLV";
+    static const char model[MEMMODELS + 1] = "SMCLV";
 
 #if MARS
     memcpy(library,"SM?",4);
@@ -1262,7 +1262,7 @@
 
 void obj_compiler()
 {
-    static const char compiler[] = "\0\xDBDigital Mars C/C++"
+    static const char compiler[] = "\0\xDB" "Digital Mars C/C++"
         VERSION
         ;       // compiled by ...
 
@@ -1290,7 +1290,7 @@
   int texti = 8;                                // index of _TEXT
 
   static char comment[] = {0,0x9D,'0','?','O'}; // memory model
-  static char model[MEMMODELS] = "smclv";
+  static char model[MEMMODELS + 1] = "smclv";
   static char exten[] = {0,0xA1,1,'C','V'};     // extended format
   static char pmdeb[] = {0x80,0xA1,1,'H','L','L',0};    // IBM PM debug format
 
@@ -1606,7 +1606,7 @@
 {
     // We need to always put out the segments in triples, so that the
     // linker will put them in the correct order.
-    static char lnames[4][5+4+5] =
+    static char lnames[4][5+4+5 +1] =
     {   "\03XIB\02XI\03XIE",            // near constructor
         "\03XCB\02XC\03XCE",            // near destructor
         "\04XIFB\03XIF\04XIFE",         // far constructor
@@ -2893,10 +2893,11 @@
  *      nbytes
  */
 
-unsigned obj_bytes(int seg,targ_size_t offset,unsigned nbytes, void *p)
+unsigned obj_bytes(int seg,targ_size_t offset,unsigned nbytes, void *_p)
 {   unsigned n = nbytes;
 
     //dbg_printf("obj_bytes(seg=%d, offset=x%lx, nbytes=x%x, p=%p)\n",seg,offset,nbytes,p);
+	char* p = (char*)_p;
  L1:
     if (
         (seg != obj.ledata->lseg ||                     // and segments don't match
@@ -2909,7 +2910,7 @@
         while (nbytes)
         {   obj_byte(seg,offset,*(char *)p);
             offset++;
-            ((char *)p)++;
+            ((char *)(p))++;
             nbytes--;
             if (obj.ledata->i + nbytes <= LEDATAMAX)
                 goto L1;
Index: backend/cod3.c
===================================================================
--- backend/cod3.c	(revision 766)
+++ backend/cod3.c	(working copy)
@@ -3996,7 +3996,7 @@
 
 #define GEN(c)          (*pgen++ = (c))
 #define GENP(n,p)       (memcpy(pgen,(p),(n)), pgen += (n))
-#if ELFOBJ || MACHOBJ
+#if ELFOBJ || MACHOBJ || _MSC_VER
 #define FLUSH()         if (pgen-bytes) cod3_flush()
 #else
 #define FLUSH()         ((pgen - bytes) && cod3_flush())
Index: backend/cgelem.c
===================================================================
--- backend/cgelem.c	(revision 766)
+++ backend/cgelem.c	(working copy)
@@ -4237,7 +4237,7 @@
         }
     }
     else if (OTbinary(op))              // if binary operator
-    {   HINT leftgoal,rightgoal;
+    {   HINT leftgoal = 1,rightgoal;
 
         /* Determine goals for left and right subtrees  */
         rightgoal = (goal || OTsideff(op));
Index: backend/cc.h
===================================================================
--- backend/cc.h	(revision 766)
+++ backend/cc.h	(working copy)
@@ -1443,7 +1443,11 @@
 /* Format the identifier for presentation to the user   */
 char *cpp_prettyident (Symbol *s);
 
+#if SCPP
 inline char *prettyident(Symbol *s) { return CPP ? cpp_prettyident(s) : s->Sident; }
+#else
+inline char *prettyident(Symbol *s) { return s->Sident; }
+#endif
 
 /**********************************
  * Function parameters:
Index: toobj.c
===================================================================
--- toobj.c	(revision 766)
+++ toobj.c	(working copy)
@@ -918,7 +918,7 @@
 
 void InterfaceDeclaration::toObjFile(int multiobj)
 {   unsigned i;
-    unsigned offset;
+    unsigned offset = 0;
     Symbol *sinit;
     enum_SC scclass;
 
Index: util.c
===================================================================
--- util.c	(revision 766)
+++ util.c	(working copy)
@@ -81,7 +81,7 @@
 }
 
 
-#if _WIN32
+#if _WIN32 && !defined(_MSC_VER)
 
 volatile int controlc_saw;
 
@@ -131,7 +131,7 @@
 
 #endif
 
-#if linux || __APPLE__ || __FreeBSD__ || __sun&&__SVR4
+#if linux || __APPLE__ || __FreeBSD__ || __sun&&__SVR4 || _MSC_VER
 void util_progress()
 {
 }
@@ -237,7 +237,7 @@
  * If c is a power of 2, return that power else -1.
  */
 
-int ispow2(unsigned long long c)
+int ispow2(targ_ullong c)
 {       int i;
 
         if (c == 0 || (c & (c - 1)))
Index: expression.c
===================================================================
--- expression.c	(revision 766)
+++ expression.c	(working copy)
@@ -2067,6 +2067,7 @@
         : Expression(loc, TOKidentifier, sizeof(IdentifierExp))
 {
     this->ident = ident;
+	var = NULL;
 }
 
 Expression *IdentifierExp::semantic(Scope *sc)
Index: libomf.c
===================================================================
--- libomf.c	(revision 766)
+++ libomf.c	(working copy)
@@ -259,6 +259,7 @@
                 if (easyomf)
                     recTyp = COMDAT+1;          // convert to MS format
             case COMDAT+1:
+			{
                 int pickAny = 0;
 
                 if (*p++ & 5)           // if continuation or local comdat
@@ -290,6 +291,7 @@
 
                 //printf("[s] name='%s'\n",name);
                 addSymbol(om, (char *)names.data[idx],pickAny);
+			}
                 break;
 
             case ALIAS:
@@ -488,10 +490,12 @@
                     om->length = pnext - om->base;
                     om = NULL;
                 }
+				{
                 // Round up to next page
                 unsigned t = pnext - pstart;
                 t = (t + g_page_size - 1) & ~(unsigned)(g_page_size - 1);
                 pnext = pstart + t;
+				}
                 break;
 
             default:
Index: tocsym.c
===================================================================
--- tocsym.c	(revision 766)
+++ tocsym.c	(working copy)
@@ -86,8 +86,13 @@
         n += 2;
     }
 #endif
-    id = (char *) alloca(2 + nlen + sizeof(size_t) * 3 + strlen(prefix) + strlen(suffix) + 1);
-    sprintf(id,"_D%s%zu%s%s", n, strlen(prefix), prefix, suffix);
+	size_t	size = 2 + nlen + sizeof(size_t) * 3 + strlen(prefix) + strlen(suffix) + 1;
+    id = (char *) alloca(size);
+#ifdef _MSC_VER
+	sprintf(id,"_D%s%Iu%s%s", n, strlen(prefix), prefix, suffix);
+#else
+	sprintf(id,"_D%s%zu%s%s", n, strlen(prefix), prefix, suffix);
+#endif
 #if 0
     if (global.params.isWindows &&
         (type_mangle(t) == mTYman_c || type_mangle(t) == mTYman_std))
Index: interpret.c
===================================================================
--- interpret.c	(revision 766)
+++ interpret.c	(working copy)
@@ -1345,6 +1345,10 @@
             else if (!e->type)
                 e->type = v->type;
         }
+		else
+		{
+	        e = EXP_CANT_INTERPRET;
+		}
     }
     else if (declaration->isAttribDeclaration() ||
              declaration->isTemplateMixin() ||
