--- ncl-6.6.2/ncarg2d/src/libncarg_gks/bwi/argb2ci.f.orig	2019-02-28 00:44:39.000000000 +0100
+++ ncl-6.6.2/ncarg2d/src/libncarg_gks/bwi/argb2ci.f	2020-11-13 16:00:28.210743708 +0100
@@ -16,10 +16,10 @@
       integer index, nearest
       integer i
       integer ARGBMASK, RMASK, GMASK, BMASK
-      parameter (ARGBMASK = Z'40000000')
-      parameter (RMASK     = Z'00FF0000')
-      parameter (GMASK     = Z'0000FF00')
-      parameter (BMASK     = Z'000000FF')
+      parameter (ARGBMASK = int(Z'40000000'))
+      parameter (RMASK     = int(Z'00FF0000'))
+      parameter (GMASK     = int(Z'0000FF00'))
+      parameter (BMASK     = int(Z'000000FF'))
       real r, g, b, dist, mindist
 
       if (iand(index, ARGBMASK).eq.0) then
@@ -31,8 +31,8 @@
       mindist = 2e31
       nearest = 0
       do i=1,mol
-          r = (iand(index, RMASK) / Z'0000FFFF') / 255.
-          g = (iand(index, GMASK) / Z'000000FF') / 255.
+          r = (iand(index, RMASK) / int(Z'0000FFFF')) / 255.
+          g = (iand(index, GMASK) / int(Z'000000FF')) / 255.
           b = (iand(index, BMASK))               / 255.
 
 C         we don't need absolute distance, so forego the sqrt operation...
--- ncl-6.6.2/ni/src/ncl/NclApi.c	2019-02-28 00:44:39.000000000 +0100
+++ NclApi.c	2020-11-16 11:36:39.493087113 +0100
@@ -140,9 +140,9 @@
 extern char *the_input_buffer_ptr;
 extern int the_input_buffer_size;
 
-FILE *thefptr;
-FILE *theoptr;
-int cmd_line;
+extern FILE *thefptr;
+extern FILE *theoptr;
+extern int cmd_line;
 extern int cur_line_number;
 extern char *cur_line_text;
 extern int cur_line_maxsize;
--- ncl-6.6.2/ni/src/ncl/NclNewHDF5.c	2019-02-28 00:44:39.000000000 +0100
+++ NclNewHDF5.c	2020-11-16 11:38:28.137952623 +0100
@@ -82,7 +82,7 @@
 
 #define NUMPOSDIMNAMES	6
 
-NclQuark possibleDimNames[NUMPOSDIMNAMES];
+extern NclQuark possibleDimNames[NUMPOSDIMNAMES];
 
 #ifndef FALSE
 #define FALSE           0
