This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Message in console: INCORRECT #define directive: in numeric_utils.hpp for: TOKEN{["#define ",<DEFINE>,line=53,col=1],offset=1965,file=null} MACRO{["BOOST_SPIRIT_LOG2",<ID>,line=53,col=9],offset=1973,file=null}BODY{["(",<LPAREN>,line=53,col=27],offset=1991,file=null ["#",<SHARP>,line=53,col=28],offset=1992,file=null ["error",<ID>,line=53,col=29],offset=1993,file=null} File: boost_1_54_0/boost/spirit/home/qi/numeric/detail/numeric_utils.hpp Macro definition: --------------------------8<------------------------------ // lookup table for log2(x) : 2 <= x <= 36 #define BOOST_SPIRIT_LOG2 (#error)(#error) \ (1000000)(1584960)(2000000)(2321920)(2584960)(2807350) \ (3000000)(3169920)(3321920)(3459430)(3584960)(3700430) \ (3807350)(3906890)(4000000)(4087460)(4169920)(4247920) \ (4321920)(4392310)(4459430)(4523560)(4584960)(4643850) \ (4700430)(4754880)(4807350)(4857980)(4906890)(4954190) \ (5000000)(5044390)(5087460)(5129280)(5169925) \ /***/ --------------------------8<------------------------------
Code is compiled and used in mata programming. For example file: boost_1_54_0/boost/preprocessor/iteration/detail/local.hpp has template specialization: BOOST_PP_LOCAL_MACRO(8) that wrongly expanded to: template <typename T> struct digits_traits<T, 23 > { typedef std::numeric_limits<T> numeric_limits_type; static const int value = static_cast < int > ( ( numeric_limits_type :: digits * 1000000 ) / BOOST_PP_SEQ_ELEM_23 BOOST_SPIRIT_LOG2 ) ; };
I agree that depth 23 is too long. Example with depth 2: BOOST_PP_LOCAL_MACRO(2) template <typename T> struct digits_traits<T, 2 > { typedef std::numeric_limits<T> numeric_limits_type; static const int value = static_cast < int > ( ( numeric_limits_type :: digits * 1000000 ) / BOOST_PP_SEQ_ELEM_2 BOOST_SPIRIT_LOG2 ) ; };
what is the expected behavior? Print message once per problematic line?
Extracted problem: ------------------------8<----------------------- #define BOOST_SPIRIT_LOG2 (#error)(#error) (2) (3) #define BOOST_PP_SEQ_ELEM(i, seq) BOOST_PP_SEQ_ELEM_I(i, seq) #define BOOST_PP_SEQ_ELEM_I(i, seq) BOOST_PP_SEQ_ELEM_II(BOOST_PP_SEQ_ELEM_ ## i seq) #define BOOST_PP_SEQ_ELEM_II(im) BOOST_PP_SEQ_ELEM_III(im) #define BOOST_PP_SEQ_ELEM_III(x, _) x #define BOOST_PP_NIL #define BOOST_PP_SEQ_ELEM_0(x) x, BOOST_PP_NIL #define BOOST_PP_SEQ_ELEM_1(_) BOOST_PP_SEQ_ELEM_0 #define BOOST_PP_SEQ_ELEM_2(_) BOOST_PP_SEQ_ELEM_1 #define BOOST_PP_SEQ_ELEM_3(_) BOOST_PP_SEQ_ELEM_2 int main(int argc, char** argv) { int i = BOOST_PP_SEQ_ELEM(1, BOOST_SPIRIT_LOG2); return (i); } ------------------------8<----------------------- gcc -c -g -MMD -MP -MF "build/Debug/GNU-Solaris-x86/main.o.d" -o build/Debug/GNU-Solaris-x86/main.o main.c main.c: In function 'main': main.c:16:5: error: stray '#' in program main.c:16:13: error: 'error' undeclared (first use in this function) main.c:16:13: note: each undeclared identifier is reported only once for each function it appears in
http://hg.netbeans.org/cnd-main/rev/3661878ec3ea
Integrated into 'main-silver', will be available in build *201402150001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/3661878ec3ea User: Vladimir Voskresensky <vv159170@netbeans.org> Log: fixed #235518 - A lot of misleading severe messages "INCORRECT #define directive" in the boost 1.54 - sharp with leading LPAREN is fine
What about rest messages? At least 3 places in apt module does not contain info about file. Example of message: SEVERE [org.netbeans.modules.cnd.apt]: include/sns.h, line 301: # is not followed by a macro parameter
http://hg.netbeans.org/cnd-main/rev/e0019fe9d9be
Integrated into 'main-silver', will be available in build *201402190001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/e0019fe9d9be User: Vladimir Voskresensky <vv159170@netbeans.org> Log: extra fix #235518 - A lot of misleading severe messages "INCORRECT #define directive" in the boost 1.54