(trivial 2.5.74) compilation fix drivers/mtd/mtd_blkdevs.c

(trivial 2.5.74) compilation fix drivers/mtd/mtd_blkdevs.c

Post by jun.. » Fri, 04 Jul 2003 10:50:06



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

        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;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

(trivial 2.5.74) compilation fix drivers/mtd/mtd_blkdevs.c

Post by Juan Quintel » Fri, 04 Jul 2003 12:00:33


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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

(trivial 2.5.74) compilation fix drivers/mtd/mtd_blkdevs.c

Post by Russell Kin » Fri, 04 Jul 2003 12:10:07




> 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).

--

             http://www.arm.linux.org.uk/personal/aboutme.html

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

(trivial 2.5.74) compilation fix drivers/mtd/mtd_blkdevs.c

Post by jun.. » Fri, 04 Jul 2003 12:50:12


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 :-).

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/