D
Daniel Rudy
Hello Group.
Please consider the following code:
/* this table is used in the wipedevice routine */
static const struct wipe_t
{
uchar wte[3]; /* wipe table entry */
} wipetable[] = {
{0x00, 0x00, 0x00},
{0x92, 0x29, 0x24},
{0x6D, 0xB6, 0xDB},
{0xFF, 0xFF, 0xFF},
{0x92, 0x29, 0x24},
{0x6D, 0xB6, 0xDB},
{0xAA, 0xAA, 0xAA},
{0x92, 0x29, 0x24},
{0x6D, 0xB6, 0xDB},
{0x55, 0x55, 0x55},
{0x92, 0x29, 0x24},
{0x6D, 0xB6, 0xDB},
{0x00, 0x00, 0x00}
};
When I compile the module, I'm getting the following error:
fs_dev.c:83: warning: missing braces around initializer
fs_dev.c:83: warning: (near initialization for `wipetable[0].wte')
uchar is defined as follows:
#define uchar unsigned char
This code appears before the table above, and there is no problem:
/* this table is used to help determine the CHS if the
device does not have or support CHS */
static const struct chs_xla_t
{
uint32 count;
uint16 cyl;
uint16 head;
uint16 sect;
uint16 block;
} chs_xla[] = {
{ 13668, 201, 4, 17, 68}, /* 7MB */
{ 20502, 201, 6, 17, 102}, /* 10MB */
{ 32436, 318, 6, 17, 102}, /* 16MB */
{ 41820, 615, 4, 17, 68}, /* 21MB */
{ 57222, 306, 11, 17, 187}, /* 28MB */
{ 62832, 462, 8, 17, 136}, /* 31MB */
{ 64000, 250, 16, 16, 256}, /* 32MB */
{ 80000, 400, 8, 25, 200}, /* 40MB */
{ 128000, 250, 16, 32, 512}, /* 64MB */
{ 256000, 250, 32, 32, 1024}, /* 128MB */
{ 512000, 250, 64, 32, 2048}, /* 256MB */
{ 1024000, 500, 64, 32, 2048}, /* 512MB */
{ 2048000, 500, 128, 32, 4096}, /* 1GB */
{ 4096000, 1000, 128, 32, 4096}, /* 2GB */
{ 8192000, 1024, 200, 40, 8000}, /* 4GB */
{16384000, 1024, 256, 63, 16128}, /* 8GB */
{16515072, 1024, 256, 63, 16128} /* Absolute Maximum for CHS */
};
Any ideas as to what the compiler is complaining about? I'm using gcc
on FreeBSD. The command line is as follows:
gcc -W -Wall -Wshadow -Wpointer-arith -Wcast-align -Wstrict-prototypes
-Wnested-externs -Wwrite-strings -Wfloat-equal -Winline -Wtrigraphs
-ansi -std=c89 -pedantic -ggdb3 -c -o fs_dev.o fs_dev.c
--
Daniel Rudy
Email address has been base64 encoded to reduce spam
Decode email address using b64decode or uudecode -m
Why geeks like computers: look chat date touch grep make unzip
strip view finger mount fsck more fsck yes spray umount sleep
Please consider the following code:
/* this table is used in the wipedevice routine */
static const struct wipe_t
{
uchar wte[3]; /* wipe table entry */
} wipetable[] = {
{0x00, 0x00, 0x00},
{0x92, 0x29, 0x24},
{0x6D, 0xB6, 0xDB},
{0xFF, 0xFF, 0xFF},
{0x92, 0x29, 0x24},
{0x6D, 0xB6, 0xDB},
{0xAA, 0xAA, 0xAA},
{0x92, 0x29, 0x24},
{0x6D, 0xB6, 0xDB},
{0x55, 0x55, 0x55},
{0x92, 0x29, 0x24},
{0x6D, 0xB6, 0xDB},
{0x00, 0x00, 0x00}
};
When I compile the module, I'm getting the following error:
fs_dev.c:83: warning: missing braces around initializer
fs_dev.c:83: warning: (near initialization for `wipetable[0].wte')
uchar is defined as follows:
#define uchar unsigned char
This code appears before the table above, and there is no problem:
/* this table is used to help determine the CHS if the
device does not have or support CHS */
static const struct chs_xla_t
{
uint32 count;
uint16 cyl;
uint16 head;
uint16 sect;
uint16 block;
} chs_xla[] = {
{ 13668, 201, 4, 17, 68}, /* 7MB */
{ 20502, 201, 6, 17, 102}, /* 10MB */
{ 32436, 318, 6, 17, 102}, /* 16MB */
{ 41820, 615, 4, 17, 68}, /* 21MB */
{ 57222, 306, 11, 17, 187}, /* 28MB */
{ 62832, 462, 8, 17, 136}, /* 31MB */
{ 64000, 250, 16, 16, 256}, /* 32MB */
{ 80000, 400, 8, 25, 200}, /* 40MB */
{ 128000, 250, 16, 32, 512}, /* 64MB */
{ 256000, 250, 32, 32, 1024}, /* 128MB */
{ 512000, 250, 64, 32, 2048}, /* 256MB */
{ 1024000, 500, 64, 32, 2048}, /* 512MB */
{ 2048000, 500, 128, 32, 4096}, /* 1GB */
{ 4096000, 1000, 128, 32, 4096}, /* 2GB */
{ 8192000, 1024, 200, 40, 8000}, /* 4GB */
{16384000, 1024, 256, 63, 16128}, /* 8GB */
{16515072, 1024, 256, 63, 16128} /* Absolute Maximum for CHS */
};
Any ideas as to what the compiler is complaining about? I'm using gcc
on FreeBSD. The command line is as follows:
gcc -W -Wall -Wshadow -Wpointer-arith -Wcast-align -Wstrict-prototypes
-Wnested-externs -Wwrite-strings -Wfloat-equal -Winline -Wtrigraphs
-ansi -std=c89 -pedantic -ggdb3 -c -o fs_dev.o fs_dev.c
--
Daniel Rudy
Email address has been base64 encoded to reduce spam
Decode email address using b64decode or uudecode -m
Why geeks like computers: look chat date touch grep make unzip
strip view finger mount fsck more fsck yes spray umount sleep