[Top] [All Lists]


To: David Daney <>
From: Dmitri Vorobiev <>
Date: Fri, 6 Nov 2009 19:07:54 +0200
Cc: Atsushi Nemoto <>,
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=OqlBHZmp/lTAsvFMnBVr+2eArn1No3T6bU0XrKpTjC8=; b=S8HdLXn80eD1wmtcD/mKYzzNmawjRMkoUkNnKQnq1k/nlhOnaRYWOTsyg652PknksV OgOgG0Xsgkv2JGkzjBpk6VbW/B27I2IqT0AX6jBtLkskWo+x82QSoW8drOYEkXsUV6sh gjO7x1+GVG2sUrliEoZMz4ZHGi0AIjEDLHeOs=
Domainkey-signature: a=rsa-sha1; c=nofws;; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=wJXZy2gsw2CioFaIVTbdJfAVlE/QI5JgT3QjrQfD7+nWtb0vbglmK5GuF5DilyosXe Tmci/ixdlswfQje6WXrMDHwifxZB1hxduRubhi+sCYviW6KDWTaukMLoU/UVjLORmjHw fJPgb1N0yHXTgaVQCJxy5VlVUwtfb1j9KLecs=
In-reply-to: <>
Original-recipient: rfc822;
References: <> <> <> <>
On Fri, Nov 6, 2009 at 6:44 PM, David Daney <> wrote:
> Dmitri Vorobiev wrote:
>> On Fri, Nov 6, 2009 at 6:22 PM, Dmitri Vorobiev
>> <> wrote:
>>> On Fri, Nov 6, 2009 at 6:08 PM, Atsushi Nemoto <>
>>> wrote:
>>>> Recently COMMAND_LINE_SIZE (CL_SIZE) was extended to 4096 from 512.
>>>> (commit 22242681 "MIPS: Extend COMMAND_LINE_SIZE")
>>>> This cause warning if something like buf[CL_SIZE] was declared as a
>>>> local variable, for example in prom_init_cmdline() on some platforms.
>>>> And since many Makefiles in arch/mips enables -Werror, this cause
>>>> build failure.
>>>> How can we avoid this error?
>>>> - do not use local array? (but dynamic allocation cannot be used in
>>>>  such an early stage.  static array?)
>>> Maybe a static array marked with __initdata?
>> Also, I just thought that maybe it's possible to use a c99
>> variable-length array here? Like this:
>> char buf[n];
>> This way, we don't put yet another variable in the section,
>> unlike with the static array solution.
>> However, this is totally untested, just a thought...
> It depends on your concerns.  You are still using 4096 bytes of stack, but
> you are trying to trick the compiler into not warning.
> If you think the warning is bogus, you should remove it for all code, not
> just this file.  If you think the warning is valid, then you should fix the
> code so that it doesn't use as much stack space.

Frankly, I don't think that the warning is bogus, especially if we're
talking about the case of the 4K page and 32-bit kernel, and I started
thinking htat probably the static array solution would be the safest
bet here.


<Prev in Thread] Current Thread [Next in Thread>