Subject: defkeymap.c Compile Warnings . . .

From: "Dennis Daniels" <[email-masked]>
Date: Wed, 23 Mar 2005 13:56:50 -0500

I'm having a compile problem with the generated file defkeymap.c for Linux 64-bit MIPS on the BCM1250, and was wondering if anyone has seen or heard of it. The structures in defkeymap.c are all coming out 2x what they should be . . .

Thanks ahead of time,
Dennis

Target:              BCM1250/64-bit
Linux kernel:      2.4.20
gcc:                  3.3.1

The warnings I'm getting are:

mips64_fp_be-gcc -D__KERNEL__ -I/ws/ddaniels/projects/ddaniels-01/Arch_2/Patriot/SQA/Main/Applications/thirdparty/kernel/linux/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fnostrict-aliasing -fno-common -fomit-frame-pointer -I /ws
/ddaniels/projects/ddaniels-01/Arch_2/Patriot/SQA/Main/Applications/thirdparty/kernel/linux/include/asm/gcc -mabi=64 -G 0 -mno-abicalls -fno-pic -Wa,--trap -pip
e -mtune=sb1 -mips64   -nostdinc -iwithprefix include -DKBUILD_BASENAME=defkeymap  -c -o defkeymap.o defkeymap.c
defkeymap.c:25: warning: excess elements in array initializer
defkeymap.c:25: warning: (near initialization for `plain_map')
defkeymap.c:25: warning: excess elements in array initializer
defkeymap.c:25: warning: (near initialization for `plain_map')
:
:
defkeymap.c:250: warning: excess elements in array initializer
defkeymap.c:250: warning: (near initialization for `ctrl_alt_map')
defkeymap.c:250: warning: excess elements in array initializer
defkeymap.c:250: warning: (near initialization for `ctrl_alt_map'

and the structure looks like:
u_short plain_map[NR_KEYS] = {
            0xf200,  0xf01b,  0xf031,  0xf032,  0xf033,  0xf034,  0xf035,  0xf036,
            0xf037,  0xf038,  0xf039,  0xf030,  0xf02d,  0xf03d,  0xf07f,   0xf009,
            0xfb71,  0xfb77,  0xfb65,  0xfb72,  0xfb74,  0xfb79,  0xfb75,  0xfb69,
            0xfb6f,  0xfb70,  0xf05b,  0xf05d,  0xf201,  0xf702,  0xfb61,  0xfb73,
            0xfb64,  0xfb66,  0xfb67,  0xfb68,  0xfb6a,  0xfb6b,  0xfb6c,  0xf03b,
            0xf027,  0xf060,  0xf700,  0xf05c,  0xfb7a,  0xfb78,  0xfb63,  0xfb76,
            0xfb62,  0xfb6e,  0xfb6d,  0xf02c,  0xf02e,  0xf02f,  0xf700,  0xf30c,
            0xf703,  0xf020,  0xf207,  0xf100,  0xf101,  0xf102,  0xf103,  0xf104,
            0xf105,  0xf106,  0xf107,  0xf108,  0xf109,  0xf208,  0xf209,  0xf307,
            0xf308,  0xf309,  0xf30b,  0xf304,  0xf305,  0xf306,  0xf30a,  0xf301,
            0xf302,  0xf303,  0xf300,  0xf310,  0xf206,  0xf200,  0xf03c,  0xf10a,
            0xf10b,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,
            0xf30e,  0xf702,  0xf30d,  0xf01c,  0xf701,  0xf205,  0xf114,  0xf603,
            0xf118,  0xf601,  0xf602,  0xf117,  0xf600,  0xf119,  0xf115,  0xf116,
            0xf11a,  0xf10c,  0xf10d,  0xf11b,  0xf11c,  0xf110,  0xf311,  0xf11d,
            0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,
            0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,
            0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,
            0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,
            0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,
            0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,
            0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,
            0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,
            0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,
            0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,
            0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,
            0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,
            0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,
            0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,
            0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,
            0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,
            0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,  0xf200,
};

---

From: Karsten Merker <[email-masked]>
Date: Wed, 23 Mar 2005 20:14:01 +0100

On Wed, Mar 23, 2005 at 01:56:50PM -0500, Dennis Daniels wrote:

> I'm having a compile problem with the generated file defkeymap.c for Linux
> 64-bit MIPS on the BCM1250, and was wondering if anyone has seen or heard
> of it. The structures in defkeymap.c are all coming out 2x what they
> should be . . .

AFAICS the reason is a change in the kernel headers between 2.4 and 2.6.

In 2.4, the file linux/keyboard.h has 

#define NR_KEYS         128

while in 2.6 it has

#define NR_KEYS         256

The loadkeys command that is used to generate the defkeymap.c
file has probably been built against 2.6 headers -> it generates
arrays with 256 instead of 128 entries, which would lead to the
"excess elements in array initializer" error you are
experiencing.

Regards,
Karsten
-- 
#include <standard_disclaimer>
Nach Paragraph 28 Abs. 3 Bundesdatenschutzgesetz widerspreche ich der Nutzung
oder Uebermittlung meiner Daten fuer Werbezwecke oder fuer die Markt- oder
Meinungsforschung.