signed/unsigned comparison warnings in kernel header files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have a driver that needs to be compilable with as many different kernel versions as possible. One problem I'm having is that if I specify "-Wall" to catch all warnings, the compiler sometimes complains about the kernel header files, not my code. For example, with SuSE 8.2:

/usr/src/linux-2.4.20.SuSE/include/asm/pgalloc.h: In function 'get_pgd_slow':
/usr/src/linux-2.4.20.SuSE/include/asm/pgalloc.h:38: warning: comparison between signed and unsigned
/usr/src/linux-2.4.20.SuSE/include/asm/pgalloc.h: In function `free_pgd_slow':
/usr/src/linux-2.4.20.SuSE/include/asm/pgalloc.h:99: warning: comparison between signed and unsigned


Technically, these warnings are correct. A signed integer variable is being compared with unsigned constants. So I have two questions:

1) Why do warnings like this show up only on some kernel versions, and not others? We've compiled our code with several Red Hat and SuSE versions, and this is the only one that has this problem.

2) Are certain warning levels just not acceptable for compiling the kernel? In other words, is "-Wall" always a bad idea? If so, what warning level should I use?

--
Timur Tabi
Staff Software Engineer
timur.tabi@xxxxxxxxxxx

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux