19 Jul 17:19
[PATCH] sparse: Make pre_buffer dynamically increasable
From: Atsushi Nemoto <anemo <at> mba.ocn.ne.jp>
Subject: [PATCH] sparse: Make pre_buffer dynamically increasable
Newsgroups: gmane.linux.ports.mips.general
Date: 2008-07-19 15:22:24 GMT
Subject: [PATCH] sparse: Make pre_buffer dynamically increasable
Newsgroups: gmane.linux.ports.mips.general
Date: 2008-07-19 15:22:24 GMT
I got this error when running sparse on mips kernel with gcc 4.3: builtin:272:1: warning: Newline in string or character constant The linux-mips kernel uses '$(CC) -dM -E' to generates arguments for sparse. With gcc 4.3, it generates lot of '-D' options and causes pre_buffer overflow. The linux-mips kernel can filter unused symbols out to avoid overflow, but sparse should be fixed anyway. This patch make pre_buffer dynamically increasable and add extra checking for overflow instead of silently truncating. Signed-off-by: Atsushi Nemoto <anemo <at> mba.ocn.ne.jp> --- diff --git a/lib.c b/lib.c index 0abcc9a..6e8d09b 100644 --- a/lib.c +++ b/lib.c @@ -186,7 +186,8 @@ void die(const char *fmt, ...) } static unsigned int pre_buffer_size; -static char pre_buffer[8192]; +static unsigned int pre_buffer_alloc_size; +static char *pre_buffer; int Waddress_space = 1; int Wbitwise = 0; @@ -232,12 +233,20 @@ void add_pre_buffer(const char *fmt, ...) unsigned int size;(Continue reading)
RSS Feed