G++ 4.8.5 doesn't allow a function template specialization to appear
in a namespace that is different from the namespace where the function
template was declared. Also, in that namespace, the name of the
specialized function template must be non-fully-qualified.
Fixed thus.
* include/abg-libxml-utils.h (build_sptr<xmlTextReader>): Wrap
this specialization in the namespace sptr_utils and do away with
the sptr_utils qualifier.
* include/abg-regex.h (build_sptr<regex_t>): Likewise.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
The code to build the symbol whitelist regex uses things like seekp
and tellp to generate regexes like "^foo$|^bar$".
This patch simplifies the code, for further enhancement, resulting in
generated regexes like "^(foo|bar)$".
There should be no change in behaviour, unless whitelisted symbol
names contain special regex characters.
* include/abg-regex.h (generate_from_strings): Declare new
function to build a regex from some strings, representing a
membership test.
* src/abg-regex.cc (generate_from_strings): Implement new
function to build a regex from some strings, representing a
membership test, in a straightfoward fashion.
* src/abg-tools-utils.cc
(gen_suppr_spec_from_kernel_abi_whitelists): Replace
regex-building code with a call to generate_from_strings.
* tests/test-kmi-whitelist.cc: Update regexes in test.
Signed-off-by: Giuliano Procida <gprocida@google.com>
As a prelude to adding wrapper and helper functions for regex
functionality, it makes sense to move the existing regex code (the
shared pointer type and its specialised deleter) to their own files.
This patch does this and also moves various entities into a new
namespace, abigail::regex. It removes the file abg-sptr-utils.cc which
only contained regex things.
There are no behavioural changes.
* include/Makefile.am: Add abg-regex.h.
* src/Makefile.am: Remove abg-sptr-utils.h, add abg-regex.cc
* include/abg-sptr-utils.h (regex_t_sptr): Remove this
typedef, from namespace abigail::sptr_utils.
(regex_t_deleter): Remove this struct, from namespace
abigail::sptr_utils. (build_sptr): Remove these template
specialisations, in duplicate, for regex_t_sptr.
* include/abg-regex.h: New file, introduces namespace
abigail::regex. (regex_t_sptr): Add this typedef, to namespace
abigail::regex. (regex_t_deleter): Add this struct, to
namespace abigail::regex. (build_sptr): Add these template
specialisations for regex_t_sptr
* src/abg-sptr-utils.cc: Remove this file.
* src/abg-regex.cc: Add new file with contents effectively
the same as abg-sptr-utils.cc.
* src/abg-corpus-priv.h: Update regex_t_sptr namespace
qualification.
* src/abg-corpus.cc: Ditto.
* src/abg-suppression-priv.h: Ditto.
* src/abg-suppression.cc: Ditto.
Signed-off-by: Giuliano Procida <gprocida@google.com>
Signed-off-by: Dodji Seketeli <dodji@redhat.com>