Bug 5017 - Compilation errors with gcc-4.3 snapshot
Summary: Compilation errors with gcc-4.3 snapshot
Alias: None
Product: systemtap
Classification: Unclassified
Component: translator (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Unassigned
: 5631 (view as bug list)
Depends on:
Reported: 2007-09-10 20:28 UTC by Eugeniy Meshcheryakov
Modified: 2008-01-24 16:52 UTC (History)
1 user (show)

See Also:
Last reconfirmed:

patch for missing #include (174 bytes, patch)
2007-09-10 20:29 UTC, Eugeniy Meshcheryakov
Details | Diff
workaround for gcc 4.3 build failure (517 bytes, patch)
2007-12-17 23:45 UTC, Eugeniy Meshcheryakov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eugeniy Meshcheryakov 2007-09-10 20:28:52 UTC
There are two errors when compiling systemtap with gcc-4.3 snapshot:

staptree.cxx: In static member function 'static bool
print_format::parse_print(const std::string&, bool&, bool&, bool&, bool&
staptree.cxx:356: error: 'strncmp' was not declared in this scope

In file included from main.cxx:12:
staptree.h:871: error: explicit template specialization cannot have a storage class

First one is just missing #include <cstring>.
Second one is harder to fix, it is related to this change in gcc:
http://gcc.gnu.org/ml/gcc-patches/2007-06/msg01075.html . It can be fixed by
removing second "static" in this code:
template <typename T> static void
require (deep_copy_visitor* v, T* dst, T src)
template <> static void
require <indexable *> (deep_copy_visitor* v, indexable** dst, indexable* src)

Unfortunately current gcc has bug that makes require<indexable *>() extern, so
compilation fails.
Comment 1 Eugeniy Meshcheryakov 2007-09-10 20:29:29 UTC
Created attachment 1996 [details]
patch for missing #include
Comment 2 Frank Ch. Eigler 2007-12-11 13:45:35 UTC
patch committed
Comment 3 Eugeniy Meshcheryakov 2007-12-17 23:44:19 UTC
Applied patch does not fix build failure with gcc 4.3 related to templates. It
is "static" in definition for require<indexable *>() that should be removed, not
Comment 4 Eugeniy Meshcheryakov 2007-12-17 23:45:55 UTC
Created attachment 2147 [details]
workaround for gcc 4.3 build failure

This is workaround that works for both gcc 4.2 and gcc 4.3. Suggested here:
Comment 5 Eugeniy Meshcheryakov 2008-01-17 17:51:43 UTC
*** Bug 5631 has been marked as a duplicate of this bug. ***
Comment 6 Dave Brolley 2008-01-24 16:52:14 UTC
I've committed these patches.