rm5248 opened a new issue, #344:
URL: https://github.com/apache/logging-log4cxx/issues/344

   I've come back to some code that I'm pretty sure worked before:
   
   ```
   LOG4CXX_INFO_FMT(logger, "hello");
   ```
   
   However, GCC 12.2 and clang 14 both fail to compile this code.  I'm fairly 
certain it compiled properly with GCC 10.2.
   
   The problem is that in our macros we use `__VA_ARGS__` which because there 
are no arguments seems to cause an error in these compilers.  The workaround 
for now is to simply use `LOG4CXX_INFO` instead of the `_FMT` series of macros 
or to simply add an (unused) argument, but this seems a little silly.
   
   It seems that with C++20, we could do `__VA_OPT__(,) __VA_ARGS__`.  Ideally 
we should be able to support versions before C++20 in a portable way.
   
   Some more info:
   
https://stackoverflow.com/questions/5891221/variadic-macros-with-zero-arguments
   https://gcc.gnu.org/onlinedocs/cpp/Variadic-Macros.html


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@logging.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to