fix C compilation warning about function prototype in __SET_EXTERNAL
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Fri, 06 May 2016 11:01:21 +0300
changeset 1006 0668ba32de98
parent 1005 e27c2af708ad
child 1007 afb3974f8fb3
fix C compilation warning about function prototype in __SET_EXTERNAL

Example warning:
./POUS.c:1220:3: error: function declaration isn't a prototype [-Werror=strict-prototypes]
__SET_EXTERNAL(data__->,KN_AUT,,__GET_VAR(data__->KEY_AUT.STATE_OUT));
^
compilation terminated due to -Wfatal-errors.
cc1: all warnings being treated as errors
lib/C/accessor.h
--- a/lib/C/accessor.h	Fri May 06 10:48:37 2016 +0300
+++ b/lib/C/accessor.h	Fri May 06 11:01:21 2016 +0300
@@ -125,7 +125,7 @@
 #define __SET_VAR(prefix, name, suffix, new_value)\
 	if (!(prefix name.flags & __IEC_FORCE_FLAG)) prefix name.value suffix = new_value
 #define __SET_EXTERNAL(prefix, name, suffix, new_value)\
-	{extern IEC_BYTE __IS_GLOBAL_##name##_FORCED();\
+	{extern IEC_BYTE __IS_GLOBAL_##name##_FORCED(void);\
     if (!(prefix name.flags & __IEC_FORCE_FLAG || __IS_GLOBAL_##name##_FORCED()))\
 		(*(prefix name.value)) suffix = new_value;}
 #define __SET_EXTERNAL_FB(prefix, name, suffix, new_value)\