Re: how interesting are data->bss patches?

From: Peter Samuelson (peter@cadcamlab.org)
Date: Sun Sep 24 2000 - 17:09:13 EST


[kaos]
> char __initdata *cmd[] = {
> "command1",
> "command2",
> "command3",
> NULL
> };

Actually it works fine with '-fwritable-strings'. But then you lose
for the rest of the file! Otherwise, the following works, provided you
can put up with fixed-length strings:

  char cmd[][9] __initdata = {
    "command1",
    "command2",
    "command3",
    NULL
  };

> static __initdata char str_command1[] = "command1";
> static __initdata char str_command2[] = "command2";
> static __initdata char str_command3[] = "command3";
> char __initdata *cmd[] = {
> str_command1,
> str_command2,
> str_command3,
> NULL
> };

Yes it works but it's too hard.

> char __initdata *cmd[] = {
> __initdata "command1",
> __initdata "command2",
> __initdata "command3",
> NULL
> };

Nope, parse error.

Peter
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Sep 30 2000 - 21:00:12 EST