Subject: Kernel compile warnings
From: Tor Rune Skoglund <trs@swi.no>
Date: Thu, 21 Dec 2017 21:36:54 +0100
Thu, 21 Dec 2017 21:36:54 +0100
Hi List,

When compiling a 4.1.43 kernel with the latest patch
(patch-4.1.42-vs2.3.8.6.diff) with gcc6.4.0 it show some code warnings.
(See below. ) It probably does not matter (I don't know), but I thought
I at least should mentioned it in case someone or Herbert care.

BR,
Tor Rune Skoglund

  CC      kernel/vserver/proc.o
kernel/vserver/proc.c: In function 'proc xid iterate':
kernel/vserver/proc.c:620:43: warning: comparison of constant '0' with
boolean expression is always false [-Wbool-compare]
   if (!dir emit(ctx, ".", 1, ino, DT DIR) < 0)
                                          
^
kernel/vserver/proc.c:626:44: warning: comparison of constant '0' with
boolean expression is always false [-Wbool-compare]
   if (!dir emit(ctx, "..", 2, ino, DT DIR) < 0)
                                           
^
kernel/vserver/proc.c: In function 'proc nid iterate':
kernel/vserver/proc.c:701:43: warning: comparison of constant '0' with
boolean expression is always false [-Wbool-compare]
   if (!dir emit(ctx, ".", 1, ino, DT DIR) < 0)
                                          
^
kernel/vserver/proc.c:707:44: warning: comparison of constant '0' with
boolean expression is always false [-Wbool-compare]
   if (!dir emit(ctx, "..", 2, ino, DT DIR) < 0)
                                           
^
kernel/vserver/proc.c: In function 'proc virtual iterate':
kernel/vserver/proc.c:854:43: warning: comparison of constant '0' with
boolean expression is always false [-Wbool-compare]
   if (!dir emit(ctx, ".", 1, ino, DT DIR) < 0)
                                          
^
kernel/vserver/proc.c:860:44: warning: comparison of constant '0' with
boolean expression is always false [-Wbool-compare]
   if (!dir emit(ctx, "..", 2, ino, DT DIR) < 0)
                                           
^
kernel/vserver/proc.c: In function 'proc virtnet iterate':
kernel/vserver/proc.c:935:43: warning: comparison of constant '0' with
boolean expression is always false [-Wbool-compare]
   if (!dir emit(ctx, ".", 1, ino, DT DIR) < 0)
                                          
^
kernel/vserver/proc.c:941:44: warning: comparison of constant '0' with
boolean expression is always false [-Wbool-compare]
   if (!dir emit(ctx, "..", 2, ino, DT DIR) < 0)
                                           
^
  LD      kernel/vserver/vserver.o




Hi List,

When compiling a 4.1.43 kernel with the latest patch (patch-4.1.42-vs2.3.8.6.diff) with gcc6.4.0 it show some code warnings. (See below. ) It probably does not matter (I don't know), but I thought I at least should mentioned it in case someone or Herbert care.

BR,
Tor Rune Skoglund

  CC      kernel/vserver/proc.o
kernel/vserver/proc.c: In function 'proc xid iterate':
kernel/vserver/proc.c:620:43: warning: comparison of constant '0' with boolean expression is always false [-Wbool-compare]
   if (!dir emit(ctx, ".", 1, ino, DT DIR) < 0)
                                           ^
kernel/vserver/proc.c:626:44: warning: comparison of constant '0' with boolean expression is always false [-Wbool-compare]
   if (!dir emit(ctx, "..", 2, ino, DT DIR) < 0)
                                            ^
kernel/vserver/proc.c: In function 'proc nid iterate':
kernel/vserver/proc.c:701:43: warning: comparison of constant '0' with boolean expression is always false [-Wbool-compare]
   if (!dir emit(ctx, ".", 1, ino, DT DIR) < 0)
                                           ^
kernel/vserver/proc.c:707:44: warning: comparison of constant '0' with boolean expression is always false [-Wbool-compare]
   if (!dir emit(ctx, "..", 2, ino, DT DIR) < 0)
                                            ^
kernel/vserver/proc.c: In function 'proc virtual iterate':
kernel/vserver/proc.c:854:43: warning: comparison of constant '0' with boolean expression is always false [-Wbool-compare]
   if (!dir emit(ctx, ".", 1, ino, DT DIR) < 0)
                                           ^
kernel/vserver/proc.c:860:44: warning: comparison of constant '0' with boolean expression is always false [-Wbool-compare]
   if (!dir emit(ctx, "..", 2, ino, DT DIR) < 0)
                                            ^
kernel/vserver/proc.c: In function 'proc virtnet iterate':
kernel/vserver/proc.c:935:43: warning: comparison of constant '0' with boolean expression is always false [-Wbool-compare]
   if (!dir emit(ctx, ".", 1, ino, DT DIR) < 0)
                                           ^
kernel/vserver/proc.c:941:44: warning: comparison of constant '0' with boolean expression is always false [-Wbool-compare]
   if (!dir emit(ctx, "..", 2, ino, DT DIR) < 0)
                                            ^
  LD      kernel/vserver/vserver.o