मुझे नीचे बताए गए अनुसार मेरे SNAP_LISTEN (...) मैक्रो के साथ एक समान समस्या है (हालांकि सी ++ में)। मुझे मिला एकमात्र समाधान एक नया मैक्रो SNAP_LISTEN0 (...) बनाना है जिसमें तर्क शामिल नहीं है ... पैरामीटर। मुझे अपने मामले में एक और समाधान नहीं दिख रहा है। -Wno-variadic-macros कमांड लाइन विकल्प विविध चेतावनी को रोकता है लेकिन आईएसओ सी 99 एक नहीं!
#define SNAP_LISTEN(name, emitter_name, emitter_class, signal, args...) \
if(::snap::plugins::exists(emitter_name)) \
emitter_class::instance()->signal_listen_##signal(\
boost::bind(&name::on_##signal, this, ##args));
#define SNAP_LISTEN0(name, emitter_name, emitter_class, signal) \
if(::snap::plugins::exists(emitter_name)) \
emitter_class::instance()->signal_listen_##signal(\
boost::bind(&name::on_##signal, this));
संपादित करें: संकलक संस्करण
g++ (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
संपादित करें: कमांड लाइन चेतावनी
set(CMAKE_CXX_FLAGS "-Werror -Wall -Wextra -pedantic -std=c++0x
-Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization
-Wformat=2 -Winit-self -Wlogical-op -Wmissing-include-dirs -Wnoexcept
-Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow
-Wsign-promo -Wstrict-null-sentinel -Wstrict-overflow=5 -Wswitch-default
-Wundef -Wno-unused -Wno-variadic-macros -Wno-parentheses
-fdiagnostics-show-option")
-Wno-variadic-मैक्रो ही काम करता है के बाद से मैं एक त्रुटि नहीं मिलता है कह रही है कि variadic स्वीकार नहीं किया गया है हालांकि, मुझे मैट जॉइनर के समान त्रुटि मिलती है:
cpfs.c:232:33: warning: ISO C99 requires rest arguments to be used
स्रोत
2012-10-14 07:31:17
इससे मुझे कुछ समय तक परेशान भी हुआ। असल में मानक तरीका 'log_debug ("% s", "बिटमैप रीसेट करना" होगा;'। – Dummy00001
प्रीप्रोसेसर इलिप्सिस एक या अधिक तर्कों के लिए कितना अजीब बात करता है, फिर भी सी इलिप्सिस शून्य या अधिक के लिए प्रतिस्थापित करता है। मुझे सी 99 मानक से इस अर्थपूर्ण को निकालने में कुछ परेशानी हो रही है। –