diff --git a/rtl/bsd/system.pp b/rtl/bsd/system.pp
index 3d7293bf04..59be085d33 100644
--- a/rtl/bsd/system.pp
+++ b/rtl/bsd/system.pp
@@ -80,8 +80,8 @@ end;
 
  { variable where full path and filename and executable is stored }
  { is setup by the startup of the system unit.                    }
-var
- execpathstr : shortstring;
+//var
+// execpathstr : shortstring;
 
 function paramstr(l: longint) : string;
  begin
diff --git a/rtl/objpas/classes/streams.inc b/rtl/objpas/classes/streams.inc
index 2b78195cd9..e107837893 100644
--- a/rtl/objpas/classes/streams.inc
+++ b/rtl/objpas/classes/streams.inc
@@ -534,8 +534,6 @@ end;
 
 function TMemoryStream.Realloc(var NewCapacity: Longint): Pointer;
 
-Var MoveSize : Longint;
-
 begin
   // round off to block size.
   If NewCapacity<0 Then
diff --git a/rtl/objpas/sysutils/sysutils.inc b/rtl/objpas/sysutils/sysutils.inc
index f6fa222755..9a90c6b144 100644
--- a/rtl/objpas/sysutils/sysutils.inc
+++ b/rtl/objpas/sysutils/sysutils.inc
@@ -577,9 +577,9 @@ end;
 
 function SafeLoadLibrary(const FileName: AnsiString;
   ErrorMode: DWord = {$ifdef windows}SEM_NOOPENFILEERRORBOX{$else windows}0{$endif windows}): HMODULE;
+{$if defined(cpui386) or defined(cpux86_64)}
   var
     mode : DWord;
-{$if defined(cpui386) or defined(cpux86_64)}
     fpucw : Word;
     ssecw : DWord;
 {$endif}
diff --git a/rtl/objpas/varutils.inc b/rtl/objpas/varutils.inc
index 35fcebce7a..d06ad465a0 100644
--- a/rtl/objpas/varutils.inc
+++ b/rtl/objpas/varutils.inc
@@ -316,7 +316,6 @@ end;
 
 Function SafeArrayCopyDataSpace(psa, psaOut: PVarArray): HRESULT;
 var
-  vVargSrc, vTarget: Pointer;
   vat: TVariantArrayType;
 begin
   try
diff --git a/rtl/unix/keyboard.pp b/rtl/unix/keyboard.pp
index 6d308f4e4d..fdcef4fd98 100644
--- a/rtl/unix/keyboard.pp
+++ b/rtl/unix/keyboard.pp
@@ -1049,7 +1049,6 @@ end;
 function ReadKey(var IsAlt : boolean):char;
 var
   ch       : char;
-  is_delay : boolean;
   fdsin    : tfdSet;
   store    : array [0..8] of char;
   arrayind : byte;
diff --git a/rtl/unix/video.pp b/rtl/unix/video.pp
index 54dd6a3810..55a1d11cb4 100644
--- a/rtl/unix/video.pp
+++ b/rtl/unix/video.pp
@@ -200,7 +200,9 @@ const convert:Tconversion=cv_none;
 
 var
   LastCursorType : byte;
+{$ifdef linux}
   TtyFd: Longint;
+{$endif linux}
   Console: Tconsole_type;
   cur_term_strings:Ptermcodes;
 {$ifdef logging}
@@ -960,7 +962,9 @@ end;
 
 procedure SysInitVideo;
 var
+{$ifdef linux}
   FName: String;
+{$endif linux}
   WS: packed record
     ws_row, ws_col, ws_xpixel, ws_ypixel: Word;
   end;
@@ -984,8 +988,10 @@ begin
    begin
      { save current terminal characteristics and remove rawness }
      prepareInitVideo;
+{$ifdef linux}
      { running on a tty, find out whether locally or remotely }
      TTyfd:=-1;
+{$endif linux}
      Console:=TTyNetwork;                 {Default: Network or other vtxxx tty}
      cur_term_strings:=@term_codes_vt100; {Default: vt100}
      external_codepage:=iso01;            {Default: ISO-8859-1}
@@ -1159,10 +1165,6 @@ end;
 
 
 procedure SysUpdateScreen(Force: Boolean);
-var
-  DoUpdate : boolean;
-  i : longint;
-  p1,p2 : plongint;
 begin
 {$ifdef linux}
   if console=ttylinux then
@@ -1182,8 +1184,10 @@ end;
 
 
 procedure SysSetCursorPos(NewCursorX, NewCursorY: Word);
+{$ifdef linux}
 var
   Pos : array [1..2] of Byte;
+{$endif linux}
 begin
  if (CursorX=NewCursorX) and (CursorY=NewCursorY) then
     exit;