mail[Wesnoth-commits] r28780 - /trunk/src/serialization/preprocessor.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by esr on August 20, 2008 - 03:27:
Author: esr
Date: Wed Aug 20 03:27:06 2008
New Revision: 28780

URL: http://svn.gna.org/viewcvs/wesnoth?rev=28780&view=rev
Log:
Add a comment noting that direct-recursion detection at runtime is a
dumb idea; this would be better done with a static check in wmllint,
which wouldn't impose runtime ovrerhead.  See bug #11160.

Modified:
    trunk/src/serialization/preprocessor.cpp

Modified: trunk/src/serialization/preprocessor.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/serialization/preprocessor.cpp?rev=28780&r1=28779&r2=28780&view=diff
==============================================================================
--- trunk/src/serialization/preprocessor.cpp (original)
+++ trunk/src/serialization/preprocessor.cpp Wed Aug 20 03:27:06 2008
@@ -739,9 +739,14 @@
                        preproc_map::const_iterator macro = 
target_.defines_->find(symbol);
                        if(macro != target_.defines_->end()) {                
  
 
-//! @todo it seems some addons use other names instead of include so disable 
the 
-//! code for now. Once 1.4 has been released we can try to fix it again or
+//! @todo it seems some addons use other names instead of include so disable
+//! the code for now. Once 1.4 has been released we can try to fix it again 
or
 //! make it mandatory to use INCLUDE for this purpose.
+//
+//! ESR says: No, it was a fundamentally mistaken idea to do this here; 
wmllint 
+//! could do the same direct-recursion check without imposing runtime 
overhead
+//! or causing the problems this code did.  Leaving this code in for 
+//! documentation purposes only, don't re-enable it. 
 #if 0                  
                                // INCLUDE is special and is allowed to be 
used recusively.
                                if(symbol != "INCLUDE") {
@@ -757,7 +762,7 @@
                                                }
                                        }
                                }
-#endif                                 
+#endif // 0
                                preproc_define const &val = macro->second;
                                size_t nb_arg = strings_.size() - 
token.stack_pos - 1;
                                if (nb_arg != val.arguments.size()) {




Related Messages


Powered by MHonArc, Updated Wed Aug 20 08:01:04 2008