[lkml]   [2012]   [Jan]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [PATCH] perf: Fix broken build by rearranging some #includes

    2012-01-17 11:01 AM, David Daney wrote:
    > From: David Daney<>
    > When building on my Debian/mips system, util/util.c fails to build
    > because commit 1aed2671738785e8f5aea663a6fda91aa7ef59b5 (perf kvm: Do
    > guest-only counting by default) indirectly includes stdio.h before the
    > feature selection in util.h is done. This prevents _GNU_SOURCE in
    > util.h from enabling the declaration of getline(), from now second
    > inclusion of stdio.h, and the build is broken.

    I've experienced similar problem wrt pwrite() last week. The fix was
    simply removing ctype.h from inclusion for my case.

    > There is another breakage in util/evsel.c caused by include ordering,
    > but I didn't fully track down the commit that caused it.
    > Since the #include situation is a little convoluted throughout perf, I
    > did the following:
    > 1) Always include util/util.h before all other include files.
    > 2) Remove all #define _GNU_SOURCE, as it is already done in util.h.
    > 3) Remove all #undef _GNU_SOURCE, as they don't do what a naive person
    > might expect (or much of anything for that matter) and clutter up
    > the source.
    > 4) #include ctype.h in util.h, so that ctype things have uniform
    > definitions throughout perf.

    Among other things, ctype.h isn't needed at all since util.h redefines
    all of ctype macros anyway. I've posted a patch which removes ctype.h
    inclusions as Ingo's suggestion.

    Namhyung Kim

     \ /
      Last update: 2012-01-17 08:21    [W:0.022 / U:62.736 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site