Boost logo

Boost :

From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2007-08-09 21:17:17


AMDG

I ran the attached program on the Subversion trunk.
output attached.

There are quite a few headers that suppress warnings but
fail to restore them. Some of these are harmless and a
a few are paired disable/enable headers.

In Christ,
Steven Watanabe


./boost/archive/detail/abi_prefix.hpp
./boost/archive/detail/abi_suffix.hpp
./boost/archive/impl/basic_xml_grammar.hpp
./boost/asio/detail/pop_options.hpp
./boost/asio/detail/push_options.hpp
./boost/config/compiler/visualc.hpp
./boost/fusion/sequence/container/map/detail/map_lookup.hpp
./boost/fusion/sequence/container/set/detail/set_lookup.hpp
./boost/fusion/support/detail/compiler_config.hpp
./boost/interprocess/allocators/detail/adaptive_node_pool.hpp
./boost/interprocess/allocators/detail/node_pool.hpp
./boost/interprocess/allocators/detail/node_tools.hpp
./boost/interprocess/detail/config_begin.hpp
./boost/interprocess/detail/config_end.hpp
./boost/interprocess/smart_ptr/segment_deleter.hpp
./boost/intrusive/detail/config_begin.hpp
./boost/intrusive/detail/config_end.hpp
./boost/iostreams/detail/config/disable_warnings.hpp
./boost/iostreams/detail/config/enable_warnings.hpp
./boost/operators.hpp
./boost/ptr_container/detail/static_move_ptr.hpp
./boost/python/detail/config.hpp
./boost/python/detail/wrap_python.hpp
./boost/regex/pattern_except.hpp
./boost/regex/v4/regex_workaround.hpp
./boost/serialization/collections_load_imp.hpp
./boost/serialization/detail/stack_constructor.hpp
./boost/serialization/ephemeral.hpp
./boost/serialization/hash_collections_load_imp.hpp
./boost/serialization/nvp.hpp
./boost/serialization/serialization.hpp
./boost/serialization/variant.hpp
./boost/serialization/void_cast.hpp
./boost/spirit/core/primitives/impl/primitives.ipp
./boost/spirit/core/primitives/primitives.hpp
./boost/statechart/detail/rtti_policy.hpp
./boost/statechart/detail/state_base.hpp
./boost/statechart/state_machine.hpp
./boost/static_warning.hpp
./boost/test/detail/enable_warnings.hpp
./boost/test/detail/suppress_warnings.hpp
./boost/test/utils/iterator/ifstream_line_iterator.hpp
./boost/test/utils/nullstream.hpp
./boost/test/utils/runtime/config.hpp
./boost/tuple/detail/tuple_basic_no_partial_spec.hpp
./libs/serialization/src/basic_xml_grammar.ipp
./libs/statechart/example/Camera/Camera.hpp
./libs/statechart/example/Camera/Configuring.hpp
./libs/statechart/example/Camera/Shooting.hpp
./libs/type_traits/test/test.hpp
./libs/wave/samples/cpp_tokens/cpp_tokens_config.hpp
./libs/wave/samples/list_includes/list_includes_config.hpp
./libs/wave/samples/token_statistics/token_statistics.hpp
./libs/wave/samples/waveidl/idl_config.hpp
./tools/quickbook/detail/actions.hpp
./tools/wave/cpp_config.hpp


// check_pragmas.cpp
//
// Copyright (c) 2007
// Steven Watanabe
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#include <string>
#include <iterator>
#include <iostream>
#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
#include <boost/regex.hpp>

namespace fs = boost::filesystem;

boost::regex pragmas("#\\s*pragma\\s+warning\\s*\\(\\s*((push)|(pop)|(disable))");

int main() {
    fs::recursive_directory_iterator iter(".");
    fs::recursive_directory_iterator end;
    for(; iter != end; ++iter) {
        if(!fs::is_directory(iter->path())) {
            const std::string extension(fs::extension(iter->path()));
            if(extension == ".hpp" || extension == ".ipp") {
                fs::ifstream file(iter->path());
                std::string file_contents(std::istreambuf_iterator<char>(file.rdbuf()), std::istreambuf_iterator<char>());
                int push_count = 0;
                boost::regex_iterator<std::string::iterator> regex_iter(file_contents.begin(), file_contents.end(), pragmas);
                boost::regex_iterator<std::string::iterator> regex_end;
                for(; regex_iter != regex_end; ++regex_iter) {
                    if((*regex_iter)[2].matched) {
                        ++push_count;
                    } else if((*regex_iter)[3].matched) {
                        --push_count;
                        if(push_count < 0) {
                            std::cout << *iter << std::endl;
                            goto done_with_file;
                        }
                    } else if((*regex_iter)[4].matched) {
                        if(push_count <= 0) {
                            std::cout << *iter << std::endl;
                            goto done_with_file;
                        }
                    }
                }
                if(push_count != 0) {
                     std::cout << *iter << std::endl;
                }
                done_with_file:;
            }
        }
    }
}


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk