Re: [PATCH] strbuf: stop out-of-boundary warnings from Coverity

2015-06-19 Thread Duy Nguyen
On Fri, Jun 19, 2015 at 5:50 PM, Remi Galan Alfonso remi.galan-alfo...@ensimag.grenoble-inp.fr wrote: Duy Nguyen pclo...@gmail.com writes: + sb.buf[0] = 'Z'; + printf(%c\n, strbuf_slopbuf[0]); + return 0; startup_info = git_startup_info; I might be wrong, but I definitely think that this

Re: [PATCH] strbuf: stop out-of-boundary warnings from Coverity

2015-06-19 Thread Junio C Hamano
Duy Nguyen pclo...@gmail.com writes: Anyway it does not put strbuf_slopbuf in .rodata. That's sad. I wa hoping that it would behave the same as this, which does give me SEGV: #include stdio.h static const char x = '\0'; static char *y = (char *)x; int main (void) { *y = 1; } -- To

Re: [PATCH] strbuf: stop out-of-boundary warnings from Coverity

2015-06-18 Thread Junio C Hamano
Duy Nguyen pclo...@gmail.com writes: The last resort is simply filter out a whole class of warnings. Probably good enough if both patches look equally ugly. -- 8 -- Subject: [PATCH] strbuf: kill strbuf_slopbuf, in favor of A lot of out-of-bound access warnings on scan.coverity.com is

Re: [PATCH] strbuf: stop out-of-boundary warnings from Coverity

2015-06-18 Thread Duy Nguyen
On Wed, Jun 17, 2015 at 03:12:35PM -0400, Jeff King wrote: On Wed, Jun 17, 2015 at 10:58:10AM -0700, Stefan Beller wrote: Just make strbuf_slopbuf[] large enough to keep Coverity happy. If it's happy, we'll have cleaner defect list It's down 31 defects, roughly 10% of all things

Re: [PATCH] strbuf: stop out-of-boundary warnings from Coverity

2015-06-17 Thread Junio C Hamano
Stefan Beller sbel...@google.com writes: Just make strbuf_slopbuf[] large enough to keep Coverity happy. If it's happy, we'll have cleaner defect list It's down 31 defects, roughly 10% of all things coverity detected as problematic. YAY! I actually think this is too ugly to live. If

Re: [PATCH] strbuf: stop out-of-boundary warnings from Coverity

2015-06-17 Thread Stefan Beller
On Wed, Jun 17, 2015 at 12:12 PM, Jeff King p...@peff.net wrote: On Wed, Jun 17, 2015 at 10:58:10AM -0700, Stefan Beller wrote: Just make strbuf_slopbuf[] large enough to keep Coverity happy. If it's happy, we'll have cleaner defect list It's down 31 defects, roughly 10% of all things

Re: [PATCH] strbuf: stop out-of-boundary warnings from Coverity

2015-06-17 Thread Stefan Beller
Just make strbuf_slopbuf[] large enough to keep Coverity happy. If it's happy, we'll have cleaner defect list It's down 31 defects, roughly 10% of all things coverity detected as problematic. YAY! -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to

Re: [PATCH] strbuf: stop out-of-boundary warnings from Coverity

2015-06-17 Thread Jeff King
On Wed, Jun 17, 2015 at 10:58:10AM -0700, Stefan Beller wrote: Just make strbuf_slopbuf[] large enough to keep Coverity happy. If it's happy, we'll have cleaner defect list It's down 31 defects, roughly 10% of all things coverity detected as problematic. YAY! That's a good thing. I do

Re: [PATCH] strbuf: stop out-of-boundary warnings from Coverity

2015-06-17 Thread Stefan Beller
On Wed, Jun 17, 2015 at 12:25 PM, Junio C Hamano gits...@pobox.com wrote: Stefan Beller sbel...@google.com writes: Just make strbuf_slopbuf[] large enough to keep Coverity happy. If it's happy, we'll have cleaner defect list It's down 31 defects, roughly 10% of all things coverity detected

Re: [PATCH] strbuf: stop out-of-boundary warnings from Coverity

2015-06-17 Thread Stefan Beller
On Wed, Jun 17, 2015 at 3:16 AM, Nguyễn Thái Ngọc Duy pclo...@gmail.com wrote: It usually goes like this strbuf sb = STRBUF_INIT; if (!strncmp(sb.buf, foo, 3)) printf(%s, sb.buf + 3); Coverity thinks that printf() can be executed, and because initial sb.buf only has one

[PATCH] strbuf: stop out-of-boundary warnings from Coverity

2015-06-17 Thread Nguyễn Thái Ngọc Duy
It usually goes like this strbuf sb = STRBUF_INIT; if (!strncmp(sb.buf, foo, 3)) printf(%s, sb.buf + 3); Coverity thinks that printf() can be executed, and because initial sb.buf only has one character (from strbuf_slopbuf), sb.buf + 3 is out of bound. What it does not recognize