linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] (trivial 2.5.74) compilation fix drivers/mtd/mtd_blkdevs.c
@ 2003-07-03  8:39 junkio
  2003-07-03  9:57 ` Juan Quintela
  0 siblings, 1 reply; 4+ messages in thread
From: junkio @ 2003-07-03  8:39 UTC (permalink / raw)
  To: linux-kernel

C does not let us declar variables in the middle of a block (yet).

--- 2.5.74/drivers/mtd/mtd_blkdevs.c	2003-07-03 01:32:27.000000000 -0700
+++ 2.5.74/drivers/mtd/mtd_blkdevs.c	2003-07-03 01:32:56.000000000 -0700
@@ -211,9 +211,10 @@
 	case HDIO_GETGEO:
 		if (tr->getgeo) {
 			struct hd_geometry g;
+			int ret;
 
 			memset(&g, 0, sizeof(g));
-			int ret = tr->getgeo(dev, &g);
+			ret = tr->getgeo(dev, &g);
 			if (ret)
 				return ret;

                                


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] (trivial 2.5.74) compilation fix drivers/mtd/mtd_blkdevs.c
  2003-07-03  8:39 [PATCH] (trivial 2.5.74) compilation fix drivers/mtd/mtd_blkdevs.c junkio
@ 2003-07-03  9:57 ` Juan Quintela
  2003-07-03 10:01   ` Russell King
  2003-07-03 10:42   ` junkio
  0 siblings, 2 replies; 4+ messages in thread
From: Juan Quintela @ 2003-07-03  9:57 UTC (permalink / raw)
  To: junkio; +Cc: linux-kernel

>>>>> "junkio" == junkio  <junkio@cox.net> writes:

junkio> C does not let us declar variables in the middle of a block (yet).

It depends what do you call C :)

C99 does.

Later, Juan.

-- 
In theory, practice and theory are the same, but in practice they 
are different -- Larry McVoy

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] (trivial 2.5.74) compilation fix drivers/mtd/mtd_blkdevs.c
  2003-07-03  9:57 ` Juan Quintela
@ 2003-07-03 10:01   ` Russell King
  2003-07-03 10:42   ` junkio
  1 sibling, 0 replies; 4+ messages in thread
From: Russell King @ 2003-07-03 10:01 UTC (permalink / raw)
  To: Juan Quintela; +Cc: junkio, linux-kernel

On Thu, Jul 03, 2003 at 11:57:22AM +0200, Juan Quintela wrote:
> >>>>> "junkio" == junkio  <junkio@cox.net> writes:
> 
> junkio> C does not let us declar variables in the middle of a block (yet).
> 
> It depends what do you call C :)
> 
> C99 does.

Unfortunately gcc 2.95.x does not allow it, so we shouldn't be using it
in the kernel (yet).

-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] (trivial 2.5.74) compilation fix drivers/mtd/mtd_blkdevs.c
  2003-07-03  9:57 ` Juan Quintela
  2003-07-03 10:01   ` Russell King
@ 2003-07-03 10:42   ` junkio
  1 sibling, 0 replies; 4+ messages in thread
From: junkio @ 2003-07-03 10:42 UTC (permalink / raw)
  To: Juan Quintela; +Cc: linux-kernel

>>>>> "JQ" == Juan Quintela <quintela@mandrakesoft.com> writes:

>>>>> "junkio" == junkio  <junkio@cox.net> writes:
junkio> C does not let us declare variables in the middle of a block (yet).

JQ> It depends what do you call C :)
JQ> C99 does.

That is an inappropriate comment in this list.  As far as the
kernel code is concerned, Documentation/Changes defines what C
is :-), and it says "GCC 2.95.3 or later".

Since 2.95.3 does not support declaration-in-the-middle,
decl-in-the-middle is not a valid C (yet).  On the other hand,
other C99 extentions that compiler can grok (e.g. '.FIELDNAME ='
style initializer) is now already part of valid C :-).


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-07-03 10:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-03  8:39 [PATCH] (trivial 2.5.74) compilation fix drivers/mtd/mtd_blkdevs.c junkio
2003-07-03  9:57 ` Juan Quintela
2003-07-03 10:01   ` Russell King
2003-07-03 10:42   ` junkio

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).