Uploaded image for project: 'Log4cxx'
  1. Log4cxx
  2. LOGCXX-275

Headers cannot be included with anal retentive warning settings

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 0.10.0, 0.11.0
    • None
    • Build
    • None
    • Linux, gcc 4.1.2

    Description

      My C++ project compiles with very anal retentive warning settings (-Wall -Wextra -Werror). I cannot include the log4cxx header files in this project without the attached patch. Here are the warnings that this fixes:

      ../../../src/main/include/log4cxx/helpers/objectptr.h: In copy constructor 'log4cxx::helpers::ObjectPtrT<T>::ObjectPtrT(const log4cxx::helpers::ObjectPtrT<T>&) [with T = log4cxx::helpers::Object]':
      ../../../src/main/include/log4cxx/spi/loggingevent.h:59: instantiated from here
      ../../../src/main/include/log4cxx/helpers/objectptr.h:74: warning: base class 'class log4cxx::helpers::ObjectPtrBase' should be explicitly initialized in the copy constructor

      ../../../src/main/include/log4cxx/helpers/objectptr.h: In member function 'T* log4cxx::helpers::ObjectPtrT<T>::exchange(const T*) [with T = log4cxx::Appender]':
      ../../../src/main/include/log4cxx/helpers/objectptr.h:109: instantiated from 'log4cxx::helpers::ObjectPtrT<T>& log4cxx::helpers::ObjectPtrT<T>::operator=(const log4cxx::helpers::ObjectPtrT<T>&) [with T = log4cxx::Appender]'
      appenderattachableimpl.cpp:90: instantiated from here
      ../../../src/main/include/log4cxx/helpers/objectptr.h:174: warning: dereferencing type-punned pointer will break strict-aliasing rules

      Attachments

        1. warnings.patch
          2 kB
          Evan Jones

        Activity

          People

            carnold@apache.org Curt Arnold
            evanj Evan Jones
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: