Add coment warning about incorrect implementation of the NE standard function.
authorMario de Sousa <msousa@fe.up.pt>
Thu, 29 Mar 2012 19:03:40 +0100
changeset 494 bcd737ad27f7
parent 493 9424a8ba2e13
child 495 8c6823fee086
Add coment warning about incorrect implementation of the NE standard function.
lib/create_standard_function_txt.sh
lib/iec_std_lib.h
--- a/lib/create_standard_function_txt.sh	Thu Mar 29 18:57:53 2012 +0100
+++ b/lib/create_standard_function_txt.sh	Thu Mar 29 19:03:40 2012 +0100
@@ -711,6 +711,13 @@
     /**************/
 /* Should be for: ANY_ELEMENTARY, but we currently do not support WSTRING yet... */
 /* However, we can call __ANY_ELEMENTARY since the __ANY_STRING macro does not call DO(WSTRING) */
+/* NOTE (by mjs) : The following declaration is worng, as it assumes that only 2 parameter may be used!
+ *                 The NE function is actually an extensible function, that may be called with more than 2 parameters!
+ *                 This needs to be fixed!!
+ *       The correct definition is:
+ *   __function_1e(NE, BOOL, IN, TYPENAME, 1)             
+ *   __function_1e(NE_##TYPENAME, BOOL, IN, TYPENAME, 1) 
+ */
 #define __iec_(TYPENAME) \
 __function_2p(NE, BOOL, IN1, TYPENAME, IN2, TYPENAME)            /* overloaded function */ \
 __function_2p(NE_##TYPENAME, BOOL, IN1, TYPENAME, IN2, TYPENAME) /* explicitly typed function */
--- a/lib/iec_std_lib.h	Thu Mar 29 18:57:53 2012 +0100
+++ b/lib/iec_std_lib.h	Thu Mar 29 19:03:40 2012 +0100
@@ -1753,6 +1753,10 @@
     /*     NE     */
     /**************/
 
+/* NOTE (by mjs) : The following declaration is worng, as it assumes that only 2 parameter may be used!
+ *                 The NE function is actually an extensible function, that may be called with more than 2 parameters!
+ *                 This needs to be fixed!!
+ */
 #define __ne_num(fname, TYPENAME) \
 static inline BOOL fname(EN_ENO_PARAMS, TYPENAME op1, TYPENAME op2){\
   TEST_EN(BOOL)\