Error Stdc Format Macros Redefined
Contents |
Sign in Pricing Blog Support Search GitHub This repository Watch 168 Star 1,505 Fork 349 gabime/spdlog Code Issues 11 Pull requests 4 Projects 0 Wiki __file__ macro Pulse Graphs New issue Visual Studio w/ Clang will not compile #190
__date__ Format
Closed LukeMauldin opened this Issue Mar 29, 2016 · 3 comments Projects None yet Labels None yet predefined macros in c Milestone No milestone Assignees No one assigned 3 participants LukeMauldin commented Mar 29, 2016 Multiple compile errors with Visual Studio 2015 Update 2 RC and Clang. Steps to reproduce: __time__ in c Create new project: Templates -> Visual C++ -> Cross Platform -> Dynamic Library (windows) for Clang 3.7 with Microsoft Code Generation Add spdlog files into project and try to compile and include "spdlog.h". Output of errors 1>------ Build started: Project: Clangspdlog, Configuration: Debug Win32 ------ 1> dllmain.cpp 1> format.cc 1> In file included from spdlog\details\format.cc:28: 1>spdlog\details/format.h(93,10): warning : unknown pragma ignored
C++ __file__ Without Path
[-Wunknown-pragmas] 1> # pragma intrinsic(_BitScanReverse) 1> ^ 1>spdlog\details/format.h(938,10): warning : 'FMT_BUILTIN_CLZ' macro redefined [-Wmacro-redefined] 1> # define FMT_BUILTIN_CLZ(n) __builtin_clz(n) 1> ^ 1> spdlog\details/format.h(100,10) : note: previous definition is here 1> # define FMT_BUILTIN_CLZ(n) fmt::internal::clz(n) 1> ^ 1>spdlog\details/format.h(942,10): warning : 'FMT_BUILTIN_CLZLL' macro redefined [-Wmacro-redefined] 1> # define FMT_BUILTIN_CLZLL(n) __builtin_clzll(n) 1> ^ 1> spdlog\details/format.h(121,10) : note: previous definition is here 1> # define FMT_BUILTIN_CLZLL(n) fmt::internal::clzll(n) 1> ^ 1>spdlog\details/format.cc(80,37): error : redefinition of 'strerror_r' 1> static inline fmt::internal::Null<> strerror_r(int, char *, ...) { 1> ^ 1> spdlog\details/format.cc(80,37) : note: previous definition is here 1> static inline fmt::internal::Null<> strerror_r(int, char *, ...) { 1> ^ 1>spdlog\details/format.cc(83,37): error : redefinition of 'strerror_s' 1> static inline fmt::internal::Null<> strerror_s(char *, std::size_t, ...) { 1> ^ 1> spdlog\details/format.cc(83,37) : note: previous definition is here 1> static inline fmt::internal::Null<> strerror_s(char *, std::size_t, ...) { 1> ^ 1>spdlog\details/format.cc(93,12): error : redefinition of 'fmt_snprintf' 1> inline int fmt_snprintf(char *buffer, size_t size, const char *format, ...) { 1> ^ 1> spdlog\details/format.cc(93,12) : note: previous definition is here 1> inline int fmt_snprintf(char *buffer, size_t size, const char *format, ...) { 1> ^ 1>spdlog\details/format.cc(112,8): error
and build process. This file is then included when needed by files part of the public libstdc++ API, like
C++11 __func__
information for the API. Only those macros listed below are offered for consideration by the general public. Below is the macro which users may check for library version https://github.com/gabime/spdlog/issues/190 information. __GLIBCXX__The current version of libstdc++ in compressed ISO date format, as an unsigned long. For details on the value of this particular macro for a particular release, please consult the ABI Policy and Guidelines appendix. Below are the macros which users may change with #define/#undef or with -D/-U compiler flags. The default state of the symbol https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_macros.html is listed.“Configurable” (or “Not configurable”) means that the symbol is initially chosen (or not) based on --enable/--disable options at library build and configure time (documented in Configure), with the various --enable/--disable choices being translated to #define/#undef). ABI means that changing from the default value may mean changing the ABI of compiled code. In other words, these choices control code which has already been compiled (i.e., in a binary such as libstdc++.a/.so). If you explicitly #define or #undef these macros, the headers may see different code paths, but the libraries which you link against will not. Experimenting with different values with the expectation of consistent linkage requires changing the config headers before building/installing the library. _GLIBCXX_USE_DEPRECATED Defined by default. Not configurable. ABI-changing. Turning this off removes older ARM-style iostreams code, and other anachronisms from the API. This macro is dependent on the version of the standard being tracked, and as a result may give different results for -std=c++98 and -std=c++11. This may be useful in updating old C++ code
They differ mostly in what they look like when they are used. Object-like macros resemble data objects https://gcc.gnu.org/onlinedocs/gcc-3.0.1/cpp_3.html when used, function-like macros resemble function calls. You may define any valid identifier as a macro, http://www.boost.org/doc/libs/master/libs/config/doc/html/boost_config/boost_macro_reference.html even if it is a C keyword. The preprocessor does not know anything about keywords. This can be useful if you wish to hide a keyword such as const from an older compiler that does not understand it. However, the preprocessor operator defined (see section 4.2.3 Defined) can never be defined as a macro, and C++'s named operators (see section 3.7.4 C++ in c Named Operators) cannot be macros when you are compiling C++. 3.1 Object-like Macros 3.2 Function-like Macros 3.3 Macro Arguments 3.4 Stringification 3.5 Concatenation 3.6 Variadic Macros 3.7 Predefined Macros 3.8 Undefining and Redefining Macros 3.9 Macro Pitfalls [ < ] [ > ] [ << ] [ Up ] [ >> ] [Top] [Contents] [Index] [ ? ] 3.1 Object-like Macros An object-like macro is a simple identifier which will be replaced error stdc format by a code fragment. It is called object-like because it looks like a data object in code that uses it. They are most commonly used to give symbolic names to numeric constants. You create macros with the `#define' directive. `#define' is followed by the name of the macro and then the token sequence it should be an abbreviation for, which is variously referred to as the macro's body, expansion or replacement list. For example, #define BUFFER_SIZE 1024 defines a macro named BUFFER_SIZE as an abbreviation for the token 1024. If somewhere after this `#define' directive there comes a C statement of the form foo = (char *) malloc (BUFFER_SIZE); then the C preprocessor will recognize and expand the macro BUFFER_SIZE. The C compiler will see the same tokens as it would if you had written foo = (char *) malloc (1024); By convention, macro names are written in upper case. Programs are easier to read when it is possible to tell at a glance which names are macros. The macro's body ends at the end of the `#define' line. You may continue the definition onto multiple lines, if necessary, using backslash-newline. When the macro is expanded, however, it will all come out on one line. For example, #define NUMBERS 1, \ 2, \ 3 int x[] = { NUMBERS }; ==> int x[] = { 1, 2, 3 }; The m
Boost Macro Reference Macros that describe C++03 defects Macros that describe optional features Macros that describe possible C++ future features Macros that describe C++11 features not supported Macros that allow use of C++11 features with C++03 compilers Macros that describe C++14 features not supported Macros that allow use of C++14 features with C++11 or earlier compilers Boost Helper Macros Boost Informational Macros Boost Deprecated Macros Macros for libraries with separate source code Macros that describe C++03 defects The following macros all describe features that are required by the C++03 standard, if one of the following macros is defined, then it represents a defect in the compiler's conformance with the 2003 standard. Macro Section Description BOOST_BCB_PARTIAL_SPECIALIZATION_BUG Compiler The compiler exhibits certain partial specialisation bug - probably Borland C++ Builder specific. BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL Compiler Argument dependent lookup fails if there is a using declaration for the symbol being looked up in the current scope. For example, using boost::get_pointer; prevents ADL from finding overloads of get_pointer in namespaces nested inside boost (but not elsewhere). Probably Borland specific. BOOST_NO_ADL_BARRIER Compiler The compiler locates and searches namespaces that it should *not* in fact search when performing argument dependent lookup. BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP Compiler Compiler does not implement argument-dependent lookup (also named Koenig lookup); see std::3.4.2 [basic.koenig.lookup] BOOST_NO_AUTO_PTR Standard library If the compiler / library supplies non-standard or broken std::auto_ptr. BOOST_NO_COMPLETE_VALUE_INITIALIZATION Compiler Compiler has not completely implemented value-initialization. See also The Utility/Value Init docs BOOST_NO_CTYPE_FUNCTIONS P