This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Fix unused static symbols so they're not dropped by clang
- From: pinskia at gmail dot com
- To: David Blaikie <dblaikie at gmail dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, Eric Christopher <echristo at gmail dot com>, Doug Evans <dje at google dot com>
- Date: Fri, 11 Apr 2014 00:03:28 -0700
- Subject: Re: [patch] Fix unused static symbols so they're not dropped by clang
- Authentication-results: sourceware.org; auth=none
- References: <CAENS6Es8jHe=xp1Ca0WiZ2dg2JNqJ5JYLP89CCBGWWqPQ20rrQ at mail dot gmail dot com>
> On Apr 10, 2014, at 11:51 PM, David Blaikie <dblaikie@gmail.com> wrote:
>
> Several tests used file-static functions and variables that were not
> referenced by the code. Even at -O0, clang omits these entities at the
> frontend so the tests fail.
I think clang should change here rather than the testsuite of gdb. Unused static functions make sense to be kept around at -O0 for debugging reasons.
Thanks,
Andrew
>
> Since it doesn't look like these tests needed this functionality for
> what they were testing, I've modified the variables/functions to
> either be non-static, or marked them with __attribute__((used)).
>
> If it's preferred that I use the attribute more pervasively, rather
> than just making the entities non-static, I can provide a patch for
> that (or some other preferred solution). There's certainly precedent
> for both (non-static entities and __attribute__((used)) in the
> testsuite already and much more of the former than the latter).
>
> I have commit-after-review access, so just looking for sign-off here.
>
> Thanks,
> - David
> <unused.diff>