You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4cxx-dev@logging.apache.org by "Rhys Ulerich (JIRA)" <lo...@logging.apache.org> on 2014/01/08 04:30:50 UTC

[jira] [Commented] (LOGCXX-419) 'typedef spi::KeySet KeySet' changes meaning of typedef

    [ https://issues.apache.org/jira/browse/LOGCXX-419?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13865026#comment-13865026 ] 

Rhys Ulerich commented on LOGCXX-419:
-------------------------------------

This has bitten me in the past on GCC 4.6 (https://red.ices.utexas.edu/issues/2971) where I have worked around it as demonstrated in https://github.com/RhysU/suzerain/blob/master/suzerain/support/logging.cpp using hackery like

// GCC 4.6.3 dislikes some Log4cxx constructs.  Mute -fpermissive to workaround.
// Warning-only idea taken from http://stackoverflow.com/questions/10932479
// The right thing to do is to fix log4cxx, but it seems to be a failed state.
//
// If relevant, push "GCC diagnostic warning -fpermissive"
#if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 402
#pragma GCC diagnostic push
#pragma GCC diagnostic warning "-fpermissive"
#endif

#include <log4cxx/basicconfigurator.h>
#include <log4cxx/file.h>
#include <log4cxx/helpers/bytearrayinputstream.h>
#include <log4cxx/helpers/bytebuffer.h>
#include <log4cxx/helpers/exception.h>
#include <log4cxx/helpers/fileinputstream.h>
#include <log4cxx/helpers/loglog.h>
#include <log4cxx/helpers/pool.h>
#include <log4cxx/helpers/properties.h>
#include <log4cxx/logmanager.h>
#include <log4cxx/appender.h>
#include <log4cxx/spi/filter.h>
#include <log4cxx/spi/loggerrepository.h>
#include <log4cxx/propertyconfigurator.h>

#if !defined(LOG4CXX)
#define LOG4CXX 1
#endif
#include <log4cxx/helpers/aprinitializer.h>

// Matching pop for "GCC diagnostic warning -fpermissive"
#if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 402
#pragma GCC diagnostic pop
#endif

> 'typedef spi::KeySet KeySet' changes meaning of typedef
> -------------------------------------------------------
>
>                 Key: LOGCXX-419
>                 URL: https://issues.apache.org/jira/browse/LOGCXX-419
>             Project: Log4cxx
>          Issue Type: Bug
>          Components: Filter
>    Affects Versions: 0.10.0, 0.10.1
>         Environment: Ubuntu Saucy, GCC 4.8.1, Autotools
>            Reporter: Rhys Ulerich
>            Assignee: Rhys Ulerich
>
> Observed in the build...
> In file included from ../../../../log4cxx/src/main/include/log4cxx/spi/filter.h:24:0,
>                  from ../../../../log4cxx/src/main/include/log4cxx/filter/andfilter.h:27,
>                  from ../../../../log4cxx/src/main/cpp/andfilter.cpp:18:
> ../../../../log4cxx/src/main/include/log4cxx/spi/loggingevent.h:171:45: error: declaration of ‘typedef log4cxx::spi::KeySet log4cxx::spi::LoggingEvent::KeySet’ [-fpermissive]
>                          typedef spi::KeySet KeySet;
>                                              ^
> In file included from ../../../../log4cxx/src/main/include/log4cxx/helpers/objectptr.h:21:0,
>                  from ../../../../log4cxx/src/main/include/log4cxx/spi/filter.h:21,
>                  from ../../../../log4cxx/src/main/include/log4cxx/filter/andfilter.h:27,
>                  from ../../../../log4cxx/src/main/cpp/andfilter.cpp:18:
> ../../../../log4cxx/src/main/include/log4cxx/spi/loggingevent.h:46:34: error: changes meaning of ‘KeySet’ from ‘typedef class std::vector<std::basic_string<char> > log4cxx::spi::KeySet’ [-fpermissive]
>                  LOG4CXX_LIST_DEF(KeySet, LogString);
>                                   ^
> ../../../../log4cxx/src/main/include/log4cxx/log4cxx.h:48:55: note: in definition of macro ‘LOG4CXX_LIST_DEF’
>  #define LOG4CXX_LIST_DEF(N, T) typedef std::vector<T> N



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)