added explicit casts to prevent MISRA and static analysis warnings
diff --git a/src/packages/xdc/runtime/Core-label.c b/src/packages/xdc/runtime/Core-label.c
index 035d6e5..02e2c6f 100644
--- a/src/packages/xdc/runtime/Core-label.c
+++ b/src/packages/xdc/runtime/Core-label.c
@@ -33,12 +33,12 @@
     if (named == FALSE) {
         ns = Text_nameUnknown;
     }
-    else if (iname == NULL) {
+    else if (iname == (Text_CordAddr)NULL) {
         ns = Text_nameEmpty;
     }
     else {
         ns = Text_cordText(iname);
-        if (ns == NULL) {
+        if (ns == (String)NULL) {
             ns = Text_nameStatic;
         }
     }
diff --git a/src/packages/xdc/runtime/Core-mem.c b/src/packages/xdc/runtime/Core-mem.c
index 5dae645..e736524 100644
--- a/src/packages/xdc/runtime/Core-mem.c
+++ b/src/packages/xdc/runtime/Core-mem.c
@@ -80,18 +80,19 @@
     prmsHdr->self = prmsHdr;    /* mark resParms as initialized */
 
     /* use params passed from client, if any */
-    if (argPrms != NULL) {
-        Assert_isTrue(((const Types_PrmsHdr *)argPrms)->self == argPrms,
+    if (argPrms != (CPtr)NULL) {
+        Assert_isTrue(((const Types_PrmsHdr *)argPrms)->self == (Ptr)argPrms,
             Core_A_initializedParams);
 
         Core_assignParams(resPrms, argPrms, od->prmsSize,
             sizeof(IInstance_Params));
     }
 
-    instPrms = prmsHdr->instPrms;
+    instPrms = (IInstance_Params *)prmsHdr->instPrms;
 
     /* create object and add to list of dynamically created instances */
-    instHdr = Memory_calloc(od->objHeap, od->objSize, od->objAlign, eb);
+    instHdr = (Types_InstHdr *)
+        Memory_calloc(od->objHeap, od->objSize, od->objAlign, eb);
     if (instHdr == NULL) {
         return (NULL);
     }
@@ -107,7 +108,7 @@
     Gate_leaveSystem(gateKey);
 
     /* initialize fxns (if the field is present) */
-    if (od->fxnTab != (Ptr)-1) {
+    if (od->fxnTab != (CPtr)-1) {
         *((CPtr *)resObj) = od->fxnTab;
     }
 
@@ -137,7 +138,8 @@
     IArg gateKey;
 
     /* create object and add to list of dynamically created instances */
-    instHdr = Memory_calloc(od->objHeap, od->objSize, od->objAlign, eb);
+    instHdr = (Types_InstHdr *)
+        Memory_calloc(od->objHeap, od->objSize, od->objAlign, eb);
     if (instHdr == NULL) {
         return (NULL);
     }
@@ -153,7 +155,7 @@
     Gate_leaveSystem(gateKey);
 
     /* initialize fxns (if the field is present) */
-    if (od->fxnTab != (Ptr)-1) {
+    if (od->fxnTab != (CPtr)-1) {
         *((CPtr *)resObj) = od->fxnTab;
     }
 
@@ -172,7 +174,7 @@
     Types_InstHdr *instHdr;
     IArg gateKey;
 
-    if (curObj == NULL) {
+    if (curObj == (Ptr)NULL) {
         return;     /* silently ignore NULL object references */
     }
 
@@ -191,7 +193,7 @@
         Gate_leaveSystem(gateKey);
     }
 
-    if (finalFxn != NULL) {
+    if (finalFxn != (Fxn)NULL) {
         if (istat == -1) {
             ((FinalFxn1)finalFxn)(curObj);
         }
@@ -213,7 +215,7 @@
     Types_InstHdr *instHdr;
     IArg gateKey;
 
-    if (curObj == NULL) {
+    if (curObj == (Ptr)NULL) {
         return;     /* silently ignore NULL object references */
     }
 
diff --git a/src/packages/xdc/runtime/Core-smem.c b/src/packages/xdc/runtime/Core-smem.c
index b8a5115..8aa973f 100644
--- a/src/packages/xdc/runtime/Core-smem.c
+++ b/src/packages/xdc/runtime/Core-smem.c
@@ -71,14 +71,14 @@
 
     /* use params passed from client, if any */
     if (argPrms) {
-        Assert_isTrue(((const Types_PrmsHdr *)argPrms)->self == argPrms,
+        Assert_isTrue(((const Types_PrmsHdr *)argPrms)->self == (Ptr)argPrms,
             Core_A_initializedParams);
 
         Core_assignParams(resPrms, argPrms, od->prmsSize,
             sizeof(IInstance_Params));
     }
 
-    instPrms = prmsHdr->instPrms;
+    instPrms = (IInstance_Params *)prmsHdr->instPrms;
 
     /* We need to ensure that the constructed object is zeroed to be
      * consistent with created objects for which we call calloc.
@@ -87,7 +87,7 @@
     (void)memset(resObj, 0, osz);
 
     /* initialize fxns (if the field is present) */
-    if (od->fxnTab != (Ptr)-1) {
+    if (od->fxnTab != (CPtr)-1) {
         *((CPtr *)resObj) = od->fxnTab;
     }
 
@@ -108,11 +108,11 @@
     typedef Void (*FinalFxn1)(Ptr);
     typedef Void (*FinalFxn2)(Ptr, Int);
 
-    if (curObj == NULL) {
+    if (curObj == (Ptr)NULL) {
         return;     /* silently ignore NULL object references */
     }
 
-    if (finalFxn != NULL) {
+    if (finalFxn != (Fxn)NULL) {
         if (istat == -1) {
             ((FinalFxn1)finalFxn)(curObj);
         }
diff --git a/src/packages/xdc/runtime/Diags.c b/src/packages/xdc/runtime/Diags.c
index 1cd05b2..c676f6b 100644
--- a/src/packages/xdc/runtime/Diags.c
+++ b/src/packages/xdc/runtime/Diags.c
@@ -43,7 +43,7 @@
 
         /* find first/next op in the string src */
         ops = strpbrk(src, MASKOPS);
-        if (ops == NULL) {
+        if (ops == (String)NULL) {
             return;
         }
 
diff --git a/src/packages/xdc/runtime/Error.c b/src/packages/xdc/runtime/Error.c
index 1a6be8f..39b0178 100644
--- a/src/packages/xdc/runtime/Error.c
+++ b/src/packages/xdc/runtime/Error.c
@@ -161,7 +161,7 @@
     Gate_leaveSystem(gateKey);
 
     /* call any provided error hook, unless we are too deeply nested */
-    if (Error_raiseHook != NULL && oldCount < Error_maxDepth) {
+    if (Error_raiseHook != (Error_HookFxn)NULL && oldCount < Error_maxDepth) {
         (Error_raiseHook)(eb);
     }
 
diff --git a/src/packages/xdc/runtime/HeapMin.c b/src/packages/xdc/runtime/HeapMin.c
index 2422a6d..337227f 100644
--- a/src/packages/xdc/runtime/HeapMin.c
+++ b/src/packages/xdc/runtime/HeapMin.c
@@ -61,7 +61,7 @@
     /* Make sure there is enough memory.  Must factor in the offset. */
     if (((SizeT)obj->remainSize) < size + offset) {
         Gate_leaveSystem(key);
-        return (NULL);
+        return ((Ptr)NULL);
     }
 
     /* Determine the addr based off the current buf and the needed offset. */
diff --git a/src/packages/xdc/runtime/LoggerBuf.c b/src/packages/xdc/runtime/LoggerBuf.c
index d9c783f..8f219df 100644
--- a/src/packages/xdc/runtime/LoggerBuf.c
+++ b/src/packages/xdc/runtime/LoggerBuf.c
@@ -313,7 +313,7 @@
      *
      * Otherwise, continue to log the event.
      */
-    if ((LoggerBuf_statusLogger != NULL)
+    if ((LoggerBuf_statusLogger != (xdc_runtime_ILogger_Handle)NULL)
         && ((Log_getMask(evt) & Diags_STATUS) != 0U)
         && (LoggerBuf_statusLogger
              != xdc_runtime_LoggerBuf_Handle_to_xdc_runtime_ILogger(obj))) {
@@ -340,7 +340,7 @@
     e = obj->curEntry;
 
     if (e == obj->endEntry) {
-        if (adv == LoggerBuf_WRAP) {
+        if (adv == (Int)LoggerBuf_WRAP) {
             obj->curEntry = obj->entryArr;
         }
         else {
@@ -407,7 +407,7 @@
      *
      * Otherwise, continue to log the event.
      */
-    if ((LoggerBuf_statusLogger != NULL)
+    if ((LoggerBuf_statusLogger != (xdc_runtime_ILogger_Handle)NULL)
         && ((Log_getMask(evt) & Diags_STATUS) != 0U)
         && (LoggerBuf_statusLogger
              != xdc_runtime_LoggerBuf_Handle_to_xdc_runtime_ILogger(obj))) {
@@ -434,7 +434,7 @@
 
     e = obj->curEntry;
     if (e == obj->endEntry) {
-        if (adv == LoggerBuf_WRAP) {
+        if (adv == (Int)LoggerBuf_WRAP) {
             obj->curEntry = obj->entryArr;
         }
         else {
@@ -467,7 +467,7 @@
 
     e = obj->curEntry;
     if (e == obj->endEntry) {
-        if (adv == LoggerBuf_WRAP) {
+        if (adv == (Int)LoggerBuf_WRAP) {
             obj->curEntry = obj->entryArr;
         }
         else {
diff --git a/src/packages/xdc/runtime/Memory.c b/src/packages/xdc/runtime/Memory.c
index b28a93d..7eb3688 100644
--- a/src/packages/xdc/runtime/Memory.c
+++ b/src/packages/xdc/runtime/Memory.c
@@ -48,7 +48,7 @@
      *     the error was already set or
      *     it didn't set the error
      */
-    if (block == NULL && (prior == TRUE || Error_check(eb) == FALSE)) {
+    if (block == (Ptr)NULL && (prior == TRUE || Error_check(eb) == FALSE)) {
         Error_raise(eb, Error_E_memory, (IArg)heap, (IArg)size);
     }
 
@@ -115,7 +115,7 @@
                   Error_Block *eb)
 {
     Ptr block = Memory_alloc(heap, size, align, eb);
-    if (block != NULL) {
+    if (block != (Ptr)NULL) {
         /* signed Char gets extended to a signed Int, and then memset converts
          * that signed Int to an unsigned Char, which should be the same bits
          * as what we started from.
diff --git a/src/packages/xdc/runtime/Registry.c b/src/packages/xdc/runtime/Registry.c
index 4aecbc4..36ef4e8 100644
--- a/src/packages/xdc/runtime/Registry.c
+++ b/src/packages/xdc/runtime/Registry.c
@@ -34,7 +34,7 @@
     }
 
     /* First verify there are more module ids available. */
-    if (Registry_module->curId == MINMID) {
+    if (Registry_module->curId == (Types_ModuleId)MINMID) {
         return (Registry_ALL_IDS_USED);
     }
 
diff --git a/src/packages/xdc/runtime/SysMin.c b/src/packages/xdc/runtime/SysMin.c
index 5e95956..4b169d8 100644
--- a/src/packages/xdc/runtime/SysMin.c
+++ b/src/packages/xdc/runtime/SysMin.c
@@ -40,7 +40,7 @@
     Char ch;
 
     if (SysMin_bufSize != 0U) {
-        if (str != NULL) {
+        if (str != (CString)NULL) {
             ch = *str;
             str++;
             while (ch != '\0') {
@@ -80,7 +80,7 @@
 
         module->outbuf[module->outidx] = ch;
         module->outidx++;
-        if (module->outidx == SysMin_bufSize) {
+        if (module->outidx == (UInt)SysMin_bufSize) {
             module->outidx = 0;
             module->wrapped = TRUE;
         }
diff --git a/src/packages/xdc/runtime/SysStd.c b/src/packages/xdc/runtime/SysStd.c
index bf90387..d4bb5ac 100644
--- a/src/packages/xdc/runtime/SysStd.c
+++ b/src/packages/xdc/runtime/SysStd.c
@@ -33,7 +33,7 @@
 {
     Char ch;
 
-    if (str != NULL) {
+    if (str != (CString)NULL) {
         ch = *str;
         str++;
         while (ch != '\0') {
diff --git a/src/packages/xdc/runtime/Text.c b/src/packages/xdc/runtime/Text.c
index 01b53b5..7cbacaa 100644
--- a/src/packages/xdc/runtime/Text.c
+++ b/src/packages/xdc/runtime/Text.c
@@ -225,7 +225,7 @@
             return ((Int)res);
         }
 
-        if (site->file != NULL
+        if (site->file != (CString)NULL
             && ((UShort)(max - res) >= (strlen(site->file) + 5U))) {
             res += (UShort)
                 Text_xprintf(bufp, (UInt)max - (UInt)res, "\"%s\", ",
diff --git a/src/packages/xdc/services/intern/gen/Header.java b/src/packages/xdc/services/intern/gen/Header.java
index f0e4f8f..0d947a6 100644
--- a/src/packages/xdc/services/intern/gen/Header.java
+++ b/src/packages/xdc/services/intern/gen/Header.java
@@ -1417,23 +1417,26 @@
             glob.genTitleD("Module_hasMask");
             glob.out.printf("static inline xdc_Bool %1Module_hasMask(void);\n",
                 glob.cname);
-            glob.out.printf("static inline xdc_Bool %1Module_hasMask(void) \n{\n%+",
-                glob.cname);
-            glob.out.printf("%treturn (xdc_Bool)(%1%2 != NULL);\n", glob.cname,
-                "Module__diagsMask__C");
+            glob.out.printf("static inline xdc_Bool %1Module_hasMask(void)\n{"
+                + "\n%+", glob.cname);
+            glob.out.printf("%treturn (xdc_Bool)(%1%2__C != (CT__%1%2)NULL);\n",
+                glob.cname, "Module__diagsMask");
             glob.out.printf("%-}\n");
             glob.genTitleD("Module_getMask");
             glob.out.printf("static inline xdc_Bits16 %1Module_getMask(void);"
                 + "\n", glob.cname);
-            glob.out.printf("static inline xdc_Bits16 %1Module_getMask( void ) \n{\n%+", glob.cname);
-            glob.out.printf("%treturn (%1%2 != NULL) ? *%1%2 : (xdc_Bits16)0;\n", glob.cname, "Module__diagsMask__C");
+            glob.out.printf("static inline xdc_Bits16 %1Module_getMask(void)\n{"
+                + "\n%+", glob.cname);
+            glob.out.printf("%treturn (%1%2__C != (CT__%1%2)NULL) ? *%1%2__C : "
+                + "(xdc_Bits16)0;\n", glob.cname, "Module__diagsMask");
             glob.out.printf("%-}\n");
             glob.genTitleD("Module_setMask");
             glob.out.printf("static inline xdc_Void %1Module_setMask("
                 + "xdc_Bits16 mask);\n", glob.cname);
-            glob.out.printf("static inline xdc_Void %1Module_setMask(xdc_Bits16 mask)\n{\n%+", glob.cname);
-            glob.out.printf("%tif (%1%2 != NULL) {\n%+%t*%1%2 = mask;\n%-%t}\n", glob.cname,
-                "Module__diagsMask__C");
+            glob.out.printf("static inline xdc_Void %1Module_setMask(xdc_Bits16"
+                + " mask)\n{\n%+", glob.cname);
+            glob.out.printf("%tif (%1%2__C != (CT__%1%2)NULL) {\n%+%t*%1%2__C ="
+                + " mask;\n%-%t}\n", glob.cname, "Module__diagsMask");
             glob.out.printf("%-}\n");
         }