← Back to team overview

kernel-packages team mailing list archive

[Bug 1321791] Re: Warnings when building out-of-tree module with -Wsign-compare

 

Same result here.  Our out-of-tree modules builds without warning on
3.13.0-32-generic from proposed.

Thank you!

Just one note that the repo information in that wiki page doesn't really
work for ports.  Wiki suggests:

deb http://archive.ubuntu.com/ubuntu/ <release>-proposed restricted main
multiverse universe

But what's needed for non-x86/AMD64 is:

deb http://ports.ubuntu.com/ubuntu-ports/ <release>-proposed restricted
main multiverse universe

The software-center method isn't a good fit for us because these are
display-less servers; we're not really running a desktop environment.

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1321791

Title:
  Warnings when building out-of-tree module with -Wsign-compare

Status in “linux” package in Ubuntu:
  Fix Released
Status in “linux” source package in Trusty:
  Fix Committed
Status in “linux” source package in Utopic:
  Fix Released

Bug description:
  Bug originally reported and fixes provided by Brian Hart, IBM.

  Various warnings will be seen when building an out-of-tree module with
  -Wsign-compare if any of the following are included:

  include/linux/bitops.h
  include/linux/cpumask.h
  include/linux/fb.h

  Seen on post-release 14.04, with current kernel headers.

  
  Example...

  Makefile:
  ----------------------------------------
  obj-m := sample.o

  EXTRA_CFLAGS = -Wsign-compare
  ----------------------------------------

  sample.c:
  ----------------------------------------
  #include <linux/init.h>
  #include <linux/module.h>
  #include <linux/bitops.h>
  #include <linux/cpumask.h>
  #include <linux/fb.h>

  MODULE_LICENSE("GPL");

  static int sample_init(void)
  {
      printk(KERN_ALERT "sample init\n");
      return 0;
  }

  static void sample_term(void)
  {
      printk(KERN_ALERT "sample term\n");
      return;
  }

  module_init(sample_init)
  module_exit(sample_term)
  ----------------------------------------

  $ ARCH=powerpc make -C /usr/src/linux-headers-`uname -r` M=`pwd` modules
  ...
  include/asm-generic/bitops/const_hweight.h:27:70: warning: signed and unsigned type in conditional expression [-Wsign-...
  ..
  include/linux/cpumask.h:603:26: warning: signed and unsigned type in conditional expression [-Wsign-compare]
  ...
  include/linux/fb.h:650:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  ...

  
  Fix:
  -----

  upstream commits:
  - bitops.h: linux  c32fa99f0b4252633aa464e28d1cb925bd2a79df 
  - cpumask.h: linux-next  cea092c9488cbb22c8b70336ab1413e0daf350f0
  - fb.h: linux-next  ee3468739ed83d862dbbd90397aff5258f8f2c8e

  Patches will be sent to the kernel-team mailing list.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1321791/+subscriptions


References