lkml.org 
[lkml]   [2006]   [Jul]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 00/10] Kernel memory leak detector 0.8
Date
From
Catalin Marinas <catalin.marinas@gmail.com> wrote:
> On 12/07/06, Joseph Fannin <jfannin@gmail.com> wrote:
> > On Tue, Jul 11, 2006 at 02:00:05PM +0100, Catalin Marinas wrote:
> > > That's a bug in gcc-4. The __builtin_constant_p() function always
> > > returns true even when the argument is not a constant. You could try a
> > > gcc-3.4 or a patched gcc.
> >
> > Which gcc versions are affected by this?
>
> From gcc-4.0 I think but I don't know when/if it was fixed in the
> latest. I use CodeSourcery's toolchain and they fixed in in gcc-4.1
> but that's with their own patches. Try to compile the code below. It
> should work if the toolchain is OK:
>
> #include <stdlib.h>
>
> #define EXPR atoi(argv[1])
>
> int main(int argc, char *argv[])
> {
> static int a[] = {
> __builtin_constant_p(EXPR) ? EXPR : 0
> };
>
> return a[0];
> }

Fails with gcc-4.1.1-7 from Fedora Core development.
--
Dr. Horst H. von Brand User #22616 counter.li.org
Departamento de Informatica Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria +56 32 654239
Casilla 110-V, Valparaiso, Chile Fax: +56 32 797513
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-07-14 04:25    [W:0.091 / U:0.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site