linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [SPARSE] increase MAXNEST constant
@ 2003-06-21 11:53 Arnd Bergmann
  2003-06-21 17:05 ` Linus Torvalds
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2003-06-21 11:53 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel

The MAXNEST constant in sparse is currently too small for
checking most of the kernel files. The deepest nesting
I found in the kernel is 25, so MAXNEST=32 should probably
be sufficient. It would be nice to check overruns here,
but I did not know where to best do it.

The problem is hidden when sparse is compiled with gcc-3.2 
or earlier, but causes segmentation faults with gcc-3.3.

	Arnd <><

===== pre-process.c 1.65 vs edited =====
--- 1.65/pre-process.c	Wed Jun 11 01:03:25 2003
+++ edited/pre-process.c	Sat Jun 21 13:26:03 2003
@@ -28,7 +28,7 @@
 int verbose = 0;
 int preprocessing = 0;
 
-#define MAXNEST (16)
+#define MAXNEST (32)
 static int true_nesting = 0;
 static int false_nesting = 0;
 static struct token *unmatched_if = NULL;

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

* Re: [PATCH] [SPARSE] increase MAXNEST constant
  2003-06-21 11:53 [PATCH] [SPARSE] increase MAXNEST constant Arnd Bergmann
@ 2003-06-21 17:05 ` Linus Torvalds
  0 siblings, 0 replies; 2+ messages in thread
From: Linus Torvalds @ 2003-06-21 17:05 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: linux-kernel


On Sat, 21 Jun 2003, Arnd Bergmann wrote:
>
> The MAXNEST constant in sparse is currently too small for
> checking most of the kernel files.

Thanks, right you are. I fixed it a bit differently, in particular it 
doesn't need an "int", it really needs just one bit per level, but I left 
it at "char" instead.

>				 The deepest nesting
> I found in the kernel is 25, so MAXNEST=32 should probably
> be sufficient. It would be nice to check overruns here,
> but I did not know where to best do it.

I did that too (and I made the size of the nesting be 256, since changing 
it to a char means that it's fairly small).

		Linus


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

end of thread, other threads:[~2003-06-21 16:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-21 11:53 [PATCH] [SPARSE] increase MAXNEST constant Arnd Bergmann
2003-06-21 17:05 ` Linus Torvalds

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