Skip to contentSkip to conversation

2.4.5 and gcc v3 final

PATCH New Kissandrakis S. George 6 participants 11 messages Jun 20, 2001 – Jun 26, 2001

Subsystems (8)
lore
Share & tools
lore
#0 lore raw

Hello
I suppose that you allready know it
I have installed gcc v3 released Jun 18 and i tried to compile the kernel and i got
these errors

in make dep i got several warnings that look like this

/usr/src/linux-2.4.5/include/asm/checksum.h:161:17: warning: multi-line string literals are deprecated

but finally passed..

in make bzImage i got

timer.c:35: conflicting types for xtime' /usr/src/linux-2.4.5/include/linux/sched.h:540: previous declaration of xtime'

and compilation stops
if i remove the decleration of xtime in sched.h (remove the 540 line) the compile
will go on and some compiles after...

time.c: In function `do_normal_gettime':
time.c:41: `xtime' undeclared (first use in this function)

and some other errors
if in time.c include the line 540 from sched.h (the xtime) the compilation will go on
until the same error on another file
i include again the line 540 from sched.h the compilation goes on etc etc and after lots
of errors finally i got bzImage

I didnt test bzImage if it boots

with gcc v2.x the same kernel and kernel config it compiles,Is it a kernel bug, a gcc
bug or something else (bad installation of gcc, my mistake etc etc)?

Best Regards

---
Kissandrakis S. George [[email protected]]
Network and System Administrator [http://www.phaistosnetworks.gr/]
Tel:(+30 81) 391882/Fax:(+30 892) 23206
Phaistos Networks S.A. - A DOL Digital Company

#1 lore raw

Hi,

Solution is simple:
change line 540 from "extern struct timeval xtime;" to "extern volatile struct timeval xtime;" and have fun :)

---
avi

Quoted 55 lines · Kissandrakis S. George

Hello
I suppose that you allready know it
I have installed gcc v3 released Jun 18 and i tried to compile the kernel and i got
these errors

in make dep i got several warnings that look like this

/usr/src/linux-2.4.5/include/asm/checksum.h:161:17: warning: multi-line string literals are deprecated

but finally passed..

in make bzImage i got

timer.c:35: conflicting types for xtime' /usr/src/linux-2.4.5/include/linux/sched.h:540: previous declaration of xtime'

and compilation stops
if i remove the decleration of xtime in sched.h (remove the 540 line) the compile
will go on and some compiles after...

time.c: In function `do_normal_gettime':
time.c:41: `xtime' undeclared (first use in this function)

and some other errors
if in time.c include the line 540 from sched.h (the xtime) the compilation will go on
until the same error on another file
i include again the line 540 from sched.h the compilation goes on etc etc and after lots
of errors finally i got bzImage

I didnt test bzImage if it boots

with gcc v2.x the same kernel and kernel config it compiles,Is it a kernel bug, a gcc
bug or something else (bad installation of gcc, my mistake etc etc)?

Best Regards

---
Kissandrakis S. George [[email protected]]
Network and System Administrator [http://www.phaistosnetworks.gr/]
Tel:(+30 81) 391882/Fax:(+30 892) 23206
Phaistos Networks S.A. - A DOL Digital Company
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

#2 lore raw

I've just applied the "patch", but te warning still appears. Is this somthing not to be worried about or is it something serious?

/usr/src/linux-2.4.5/include/asm/checksum.h:161:17: warning: multi-line string literals are deprecated

I had to come back to 2.95 to test the ac17. Not so happy about it. :(

Please give me some directions.

Quoted 70 lines · Anatoly Ivanov

Hi,

Solution is simple:
change line 540 from "extern struct timeval xtime;" to "extern volatile struct timeval xtime;" and have fun :)

---
avi

Quoted 44 lines · Kissandrakis S. George

Hello
I suppose that you allready know it
I have installed gcc v3 released Jun 18 and i tried to compile the kernel and i got
these errors

in make dep i got several warnings that look like this

/usr/src/linux-2.4.5/include/asm/checksum.h:161:17: warning: multi-line string literals are deprecated

but finally passed..

in make bzImage i got

timer.c:35: conflicting types for xtime' /usr/src/linux-2.4.5/include/linux/sched.h:540: previous declaration of xtime'

and compilation stops
if i remove the decleration of xtime in sched.h (remove the 540 line) the compile
will go on and some compiles after...

time.c: In function `do_normal_gettime':
time.c:41: `xtime' undeclared (first use in this function)

and some other errors
if in time.c include the line 540 from sched.h (the xtime) the compilation will go on
until the same error on another file
i include again the line 540 from sched.h the compilation goes on etc etc and after lots
of errors finally i got bzImage

I didnt test bzImage if it boots

with gcc v2.x the same kernel and kernel config it compiles,Is it a kernel bug, a gcc
bug or something else (bad installation of gcc, my mistake etc etc)?

Best Regards

Quoted 11 lines

---
Kissandrakis S. George [[email protected]]
Network and System Administrator [http://www.phaistosnetworks.gr/]
Tel:(+30 81) 391882/Fax:(+30 892) 23206
Phaistos Networks S.A. - A DOL Digital Company
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Quoted 6 lines

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

---

 Fabian Arias Mu~oz                    |               Debian GNU/Linux Sid
 Facultad de Cs. Economicas y          |      	Kernel 2.4.5ac16 - ReiserFS
 Administrativas.                      |                   "aka" dewback en
 Universidad de Concepcion   -  Chile  |               #linuxhelp IRC.CHILE
#3 lore raw

As you can see, this is just deprecation warning,
i.e. you can use multi-string literals, but
you'd better don't.

You can forget about these warnings and test ac17
with gcc3.

I hope that lk-developers would fix it one day.

---
avi

Quoted 12 lines · Fabian Arias

I've just applied the "patch", but te warning still appears. Is this somthing not to be worried about or is it something serious?

/usr/src/linux-2.4.5/include/asm/checksum.h:161:17: warning: multi-line string literals are deprecated

I had to come back to 2.95 to test the ac17. Not so happy about it. :(

Please give me some directions.

On Wed, 20 Jun 2001, Anatoly Ivanov wrote:

#4 lore raw
In reply to Fabian Arias
Quoted 2 lines · Anatoly Ivanov

I hope that lk-developers would fix it one day.

Multi-string literals is a nice little ANSI C feature that appears everywhere. Why it is necessary to "fix" them?

Anuradha

Signature · 5 lines
Debian GNU/Linux (kernel 2.4.6-pre5)

For some reason a glaze passes over people's faces when you say
"Canada".  Maybe we should invade South Dakota or something.
		-- Sandra Gotlieb, wife of the Canadian ambassador to the U.S.
#5 lore raw
Quoted 6 lines · Anuradha Ratnaweera
Quoted 2 lines · Anatoly Ivanov

I hope that lk-developers would fix it one day.

Multi-string literals is a nice little ANSI C feature that appears everywhere. Why it is necessary to "fix" them?

I think that "fix" doesn't necesary mean "kill" the feature. But is a problem that some of us, compiling the ac series with gcc-3, have had.

PD: My syntaxis of english should be "deprecated", jeje

Quoted 17 lines

Anuradha

Signature · 11 lines
Debian GNU/Linux (kernel 2.4.6-pre5)

For some reason a glaze passes over people's faces when you say
"Canada".  Maybe we should invade South Dakota or something.
		-- Sandra Gotlieb, wife of the Canadian ambassador to the U.S.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

---

 Fabian Arias Mu~oz                    |               Debian GNU/Linux Sid
 Facultad de Cs. Economicas y          |      	Kernel 2.4.5ac17 - ReiserFS
 Administrativas.                      |                   "aka" dewback en
 Universidad de Concepcion   -  Chile  |               #linuxhelp IRC.CHILE
#6 lore raw
Quoted 10 lines · Fabian Arias
Quoted 5 lines · Anuradha Ratnaweera
Quoted 1 line · Anatoly Ivanov

I hope that lk-developers would fix it one day.

Multi-string literals is a nice little ANSI C feature that appears everywhere. Why it is necessary to "fix" them?

I think that "fix" doesn't necesary mean "kill" the feature. But is a problem that some of us, compiling the ac series with gcc-3, have had.

What gcc objects to is stuff like:

"This is a nice long string
that just goes on
and on\n"

which is illegal in C AFAIU. It does not object to:

"This long string"
"spans several lines, "
"but legally.\n"

The first form does/did appear in several asm()s. Fix them, send a patch.

Signature · 2 lines
Horst von Brand                             [email protected]
Casilla 9G, Vin~a del Mar, Chile                               +56 32 672616
#7 lore raw
Quoted 11 lines · Horst von Brand

What gcc objects to is stuff like:

"This is a nice long string
that just goes on
and on\n"

which is illegal in C AFAIU. It does not object to:

"This long string"
"spans several lines, "
"but legally.\n"

But the first example contains three newlines, the second just one. A thing to keep in mind when going around fixing these multi line strings, explicit newlines have to be added.

Signature · 1 line
Andreas E. Bombe <[email protected]>    DSA key 0x04880A44
#8 lore raw

PATCH 1/1 GCC v3 warning fixes #1 (Was: Re: 2.4.5 and gcc v3 final)

In reply to Horst von Brand
Quoted 7 lines · Horst von Brand

What gcc objects to is stuff like:

"This is a nice long string
that just goes on
and on\n"

Quoted 7 lines

which is illegal in C AFAIU. It does not object to:

"This long string"
"spans several lines, "
"but legally.\n"

The first form does/did appear in several asm()s. Fix them, send a patch.

Here is the first patch, which will fix warnings on many drivers. It is not tested. But most, if not all, changes should be obvious.

I have tried to keep the coding style as closely as possible to the surronding code.

Cheers,

Anuradha

Signature · 3 lines
Debian GNU/Linux (kernel 2.4.6-pre5)

Reality is just a crutch for people who can't handle science fiction.
drivers/atm/iphase.c +2 -2
diff -u --recursive --new-file linux-2.4.6-pre5/drivers/atm/iphase.c linux/drivers/atm/iphase.c
@@ -203,8 +203,8 @@
         ltimeout = dev->desc_tbl[i].iavcc->ltimeout; 
         delta = jiffies - dev->desc_tbl[i].timestamp;
         if (delta >= ltimeout) {
-           IF_ABR(printk("RECOVER run!! desc_tbl %d = %d  delta = %ld, 
-               time = %ld\n", i,dev->desc_tbl[i].timestamp, delta, jiffies);)
+           IF_ABR(printk("RECOVER run!! desc_tbl %d = %d  delta = %ld, time = %ld\n",
+				   i,dev->desc_tbl[i].timestamp, delta, jiffies);)
            if (dev->ffL.tcq_rd == dev->ffL.tcq_st) 
               dev->ffL.tcq_rd =  dev->ffL.tcq_ed;
            else 
drivers/char/cyclades.c +2 -2
diff -u --recursive --new-file linux-2.4.6-pre5/drivers/char/cyclades.c linux/drivers/char/cyclades.c
@@ -3440,8 +3440,8 @@
 		}
 #ifdef CY_DEBUG_DTR
 		printk("cyc:set_line_char dropping DTR\n");
-		printk("     status: 0x%x,
-		    0x%x\n", cy_readb(base_addr+(CyMSVR1<<index)),
+		printk("     status: 0x%x, 0x%x\n",
+		    cy_readb(base_addr+(CyMSVR1<<index)),
 		    cy_readb(base_addr+(CyMSVR2<<index)));
 #endif
 	    }else{
drivers/char/h8.c +2 -2
diff -u --recursive --new-file linux-2.4.6-pre5/drivers/char/h8.c linux/drivers/char/h8.c
@@ -575,8 +575,8 @@
         }
 
         if (intrbuf.word & H8_POWER_BUTTON) {
-                printk("Power switch pressed - please wait - preparing to power 
-off\n");
+                printk("Power switch pressed - please wait - preparing to \
+power off\n");
                 h8_set_event_mask(H8_POWER_BUTTON);
                 wake_up(&h8_monitor_wait);
         }
drivers/char/rio/riocmd.c +2 -2
diff -u --recursive --new-file linux-2.4.6-pre5/drivers/char/rio/riocmd.c linux/drivers/char/rio/riocmd.c
@@ -462,8 +462,8 @@
 		rio_dprintk (RIO_DEBUG_CMD, "PACKET information: Length	  0x%x (%d)\n", PacketP->len,PacketP->len );
 		rio_dprintk (RIO_DEBUG_CMD, "PACKET information: Control	 0x%x (%d)\n", PacketP->control, PacketP->control);
 		rio_dprintk (RIO_DEBUG_CMD, "PACKET information: Check	   0x%x (%d)\n", PacketP->csum, PacketP->csum );
-		rio_dprintk (RIO_DEBUG_CMD, "COMMAND information: Host Port Number 0x%x, 
-					Command Code 0x%x\n", PktCmdP->PhbNum, PktCmdP->Command );
+		rio_dprintk (RIO_DEBUG_CMD, "COMMAND information: Host Port Number 0x%x, Command Code 0x%x\n",
+			     PktCmdP->PhbNum, PktCmdP->Command );
 		return TRUE;
 	}
 
drivers/i2c/i2c-core.c +4 -4
diff -u --recursive --new-file linux-2.4.6-pre5/drivers/i2c/i2c-core.c linux/drivers/i2c/i2c-core.c
@@ -381,10 +381,10 @@
 						printk("i2c-core.o: while "
 						       "unregistering driver "
 						       "`%s', the client at "
-						       "address %02x of
-						       adapter `%s' could not
-						       be detached; driver
-						       not unloaded!",
+						       "address %02x of "
+						       "adapter `%s' could not "
+						       "be detached; driver "
+						       "not unloaded!",
 						       driver->name,
 						       client->addr,
 						       adap->name);
drivers/i2o/i2o_core.c +2 -2
diff -u --recursive --new-file linux-2.4.6-pre5/drivers/i2o/i2o_core.c linux/drivers/i2o/i2o_core.c
@@ -3319,8 +3319,8 @@
 	{
 		if(i2o_quiesce_controller(c))
 		{
-			printk(KERN_WARNING "i2o: Could not quiesce %s."  "
-				Verify setup on next system power up.\n", c->name);
+			printk(KERN_WARNING "i2o: Could not quiesce %s."
+				"  Verify setup on next system power up.\n", c->name);
 		}
 	}
 
drivers/net/pcmcia/fmvj18x_cs.c +1 -2
diff -u --recursive --new-file linux-2.4.6-pre5/drivers/net/pcmcia/fmvj18x_cs.c linux/drivers/net/pcmcia/fmvj18x_cs.c
@@ -572,8 +572,7 @@
     case XXX10304:
 	/* Read MACID from Buggy CIS */
 	if (fmvj18x_get_hwinfo(link, tuple.TupleData) == -1) {
-	    printk(KERN_NOTICE "fmvj18x_cs: unable to read hardware net 
-		address.");
+	    printk(KERN_NOTICE "fmvj18x_cs: unable to read hardware net address.");
 	    unregister_netdev(dev);
 	    goto failed;
 	}
drivers/net/tokenring/olympic.c +1 -2
diff -u --recursive --new-file linux-2.4.6-pre5/drivers/net/tokenring/olympic.c linux/drivers/net/tokenring/olympic.c
@@ -598,8 +598,7 @@
 	printk(" stat_ring[7]: %p\n", &(olympic_priv->olympic_rx_status_ring[7])  );
 
 	printk("RXCDA: %x, rx_ring[0]: %p\n",readl(olympic_mmio+RXCDA),&olympic_priv->olympic_rx_ring[0]);
-	printk("Rx_ring_dma_addr = %08x, rx_status_dma_addr =
-%08x\n",olympic_priv->rx_ring_dma_addr,olympic_priv->rx_status_ring_dma_addr) ; 
+	printk("Rx_ring_dma_addr = %08x, rx_status_dma_addr = %08x\n",olympic_priv->rx_ring_dma_addr,olympic_priv->rx_status_ring_dma_addr) ; 
 #endif
 
 	writew((((readw(olympic_mmio+RXENQ)) & 0x8000) ^ 0x8000) | i,olympic_mmio+RXENQ);
drivers/scsi/aic7xxx/aicasm/aicasm.c +20 -20
diff -u --recursive --new-file linux-2.4.6-pre5/drivers/scsi/aic7xxx/aicasm/aicasm.c linux/drivers/scsi/aic7xxx/aicasm/aicasm.c
@@ -264,8 +264,8 @@
 {
 
 	(void)fprintf(stderr,
-"usage: %-16s [-nostdinc] [-I-] [-I directory] [-o output_file]
-			[-r register_output_file] [-l program_list_file]
+"usage: %-16s [-nostdinc] [-I-] [-I directory] [-o output_file]\n\
+			[-r register_output_file] [-l program_list_file]\n\
 			input_file\n",
 			appname);
 	exit(EX_USAGE);
@@ -311,8 +311,8 @@
 
 	instrcount = 0;
 	fprintf(ofile,
-"/*
-  * DO NOT EDIT - This file is automatically generated.
+"/*\n\
+  * DO NOT EDIT - This file is automatically generated.\n\
   */\n");
 
 	fprintf(ofile, "static uint8_t seqprog[] = {\n");
@@ -344,12 +344,12 @@
 	    cur_node != NULL;
 	    cur_node = SLIST_NEXT(cur_node,links)) {
 		fprintf(ofile,
-"static int ahc_patch%d_func(struct ahc_softc *ahc);
-
-static int
-ahc_patch%d_func(struct ahc_softc *ahc)
-{
-	return (%s);
+"static int ahc_patch%d_func(struct ahc_softc *ahc);\n\
+\n\
+static int\n\
+ahc_patch%d_func(struct ahc_softc *ahc)\n\
+{\n\
+	return (%s);\n\
 }\n\n",
 			cur_node->symbol->info.condinfo->func_num,
 			cur_node->symbol->info.condinfo->func_num,
@@ -357,12 +357,12 @@
 	}
 
 	fprintf(ofile,
-"typedef int patch_func_t (struct ahc_softc *);
-struct patch {
-	patch_func_t	*patch_func;
-	uint32_t	begin	   :10,
-			skip_instr :10,
-			skip_patch :12;
+"typedef int patch_func_t (struct ahc_softc *);\n\
+struct patch {\n\
+	patch_func_t	*patch_func;\n\
+	uint32_t	begin	   :10,\n\
+			skip_instr :10,\n\
+			skip_patch :12;\n\
 } patches[] = {\n");
 
 	for(cur_patch = STAILQ_FIRST(&patches);
@@ -377,9 +377,9 @@
 	fprintf(ofile, "\n};\n");
 
 	fprintf(ofile,
-"struct cs {
-	u_int16_t	begin;
-	u_int16_t	end;
+"struct cs {\n\
+	u_int16_t	begin;\n\
+	u_int16_t	end;\n\
 } critical_sections[] = {\n");
 
 	for(cs = TAILQ_FIRST(&cs_tailq);
@@ -393,7 +393,7 @@
 	fprintf(ofile, "\n};\n");
 
 	fprintf(ofile,
-"const int num_critical_sections = sizeof(critical_sections)
+"const int num_critical_sections = sizeof(critical_sections)\n\
 				 / sizeof(*critical_sections);\n");
 
 	fprintf(stderr, "%s: %d instructions used\n", appname, instrcount);
drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c +2 -2
diff -u --recursive --new-file linux-2.4.6-pre5/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c linux/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c
@@ -388,8 +388,8 @@
 
 		/* Output what we have */
 		fprintf(ofile,
-"/*
-  * DO NOT EDIT - This file is automatically generated.
+"/*\n\
+  * DO NOT EDIT - This file is automatically generated.\n\
   */\n");
 		while (registers.slh_first != NULL) {
 			symbol_node_t *curnode;
drivers/scsi/sun3_NCR5380.c +1 -1
diff -u --recursive --new-file linux-2.4.6-pre5/drivers/scsi/sun3_NCR5380.c linux/drivers/scsi/sun3_NCR5380.c
@@ -1229,7 +1229,7 @@
 					    BASR_ACK)) ==
        (BASR_PHASE_MATCH | BASR_ACK)) {
 	    printk("scsi%d: BASR %02x\n", HOSTNO, NCR5380_read(BUS_AND_STATUS_REG));
-	    printk("scsi%d: bus stuck in data phase -- probably a
+	    printk("scsi%d: bus stuck in data phase -- probably a\
  single byte overrun!\n", HOSTNO); 
 	    printk("not prepared for this error!\n");
 	    printk("please e-mail [email protected] with a description of how this\n");
drivers/usb/serial/keyspan.c +1 -2
diff -u --recursive --new-file linux-2.4.6-pre5/drivers/usb/serial/keyspan.c linux/drivers/usb/serial/keyspan.c
@@ -548,8 +548,7 @@
 
 	do {
 		if (urb->status) {
-			dbg(__FUNCTION__ "nonzero status: %x on endpoint
-%d.",
+			dbg(__FUNCTION__ "nonzero status: %x on endpoint %d.",
 			    urb->status, usb_pipeendpoint(urb->pipe));
 			return;
 		}
#9 lore raw
In reply to Horst von Brand
Quoted 8 lines · Horst von Brand

Fabian Arias <[email protected]> said:

What gcc objects to is stuff like:

"This is a nice long string
that just goes on
and on\n"

Quoted 5 lines

which is illegal in C AFAIU. It does not object to:

"This long string"
"spans several lines, "
"but legally.\n"

Agreed. I was incorrectly guessing that the it was the latter.

Anuradha

Signature · 3 lines
Debian GNU/Linux (kernel 2.4.6-pre5)

Don't look now, but the man in the moon is laughing at you.
#10 lore raw
In reply to Horst von Brand
Quoted 4 lines · Andreas Bombe

But the first example contains three newlines, the second just one. A thing to keep in mind when going around fixing these multi line strings, explicit newlines have to be added.

Some code contains very long lines (around 150 characters per line) and others tend to limit lines to 72-80 lines.

And strings have been broken in the middle _just_ to keep the lines short, and sometimes without caring about the additional newline. In such cases, either, the lines should be merged or a backslash should be added to the end(s) of the line(s).

Please refer to my patch (GCC v3 warning fixes #1) for examples.

Anuradha

Signature · 4 lines
Debian GNU/Linux (kernel 2.4.6-pre5)

Journalism is literature in a hurry.
		-- Matthew Arnold