PreWord iam not a Programmer just using Marlin for my 3d Printer
This Issue only appears when I try to compile it with 1.8.6 by 1.8.4 everything is fine i hope someone can identify the «Real Bug» here
*Bug report
Marlin Software.zip
Arduino: 1.8.6 (Windows 10), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"
In file included from sketchMarlinConfig.h:26:0,
from sketchMarlin.h:36,
from sketchMarlin_main.cpp:247:
pins_GT2560_REV_A.h:93:32: error: pasting "/* Must be enabled at startup to keep power flowing*/" and "_DDR" does not give a valid preprocessing token
#define SUICIDE_PIN 54 // Must be enabled at startup to keep power flowing
^
sketchfastio.h:95:36: note: in definition of macro '_SET_OUTPUT'
#define _SET_OUTPUT(IO) do {DIO ## IO ## _DDR |= _BV(DIO ## IO ## _PIN); } while (0)
^
sketchfastio.h:113:30: note: in expansion of macro 'SET_OUTPUT'
#define OUT_WRITE(IO, v) do{ SET_OUTPUT(IO); WRITE(IO, v); }while(0)
^
sketchMarlin_main.cpp:914:5: note: in expansion of macro 'OUT_WRITE'
OUT_WRITE(SUICIDE_PIN, HIGH);
^
sketchMarlin_main.cpp:914:15: note: in expansion of macro 'SUICIDE_PIN'
OUT_WRITE(SUICIDE_PIN, HIGH);
^
pins_GT2560_REV_A.h:93:32: error: pasting "/* Must be enabled at startup to keep power flowing*/" and "_PIN" does not give a valid preprocessing token
#define SUICIDE_PIN 54 // Must be enabled at startup to keep power flowing
^
sketchfastio.h:95:61: note: in definition of macro '_SET_OUTPUT'
#define _SET_OUTPUT(IO) do {DIO ## IO ## _DDR |= _BV(DIO ## IO ## _PIN); } while (0)
^
sketchfastio.h:113:30: note: in expansion of macro 'SET_OUTPUT'
#define OUT_WRITE(IO, v) do{ SET_OUTPUT(IO); WRITE(IO, v); }while(0)
^
sketchMarlin_main.cpp:914:5: note: in expansion of macro 'OUT_WRITE'
OUT_WRITE(SUICIDE_PIN, HIGH);
^
sketchMarlin_main.cpp:914:15: note: in expansion of macro 'SUICIDE_PIN'
OUT_WRITE(SUICIDE_PIN, HIGH);
^
pins_GT2560_REV_A.h:93:32: error: pasting "/* Must be enabled at startup to keep power flowing*/" and "_RPORT" does not give a valid preprocessing token
#define SUICIDE_PIN 54 // Must be enabled at startup to keep power flowing
^
sketchfastio.h:90:41: note: in definition of macro '_WRITE'
#define _WRITE(IO, v) do { if (&(DIO ## IO ## _RPORT) >= (uint8_t *)0x100) {_WRITE_C(IO, v); } else {_WRITE_NC(IO, v); }; } while (0)
^
sketchfastio.h:113:46: note: in expansion of macro 'WRITE'
#define OUT_WRITE(IO, v) do{ SET_OUTPUT(IO); WRITE(IO, v); }while(0)
^
sketchMarlin_main.cpp:914:5: note: in expansion of macro 'OUT_WRITE'
OUT_WRITE(SUICIDE_PIN, HIGH);
^
sketchMarlin_main.cpp:914:15: note: in expansion of macro 'SUICIDE_PIN'
OUT_WRITE(SUICIDE_PIN, HIGH);
^
pins_GT2560_REV_A.h:93:32: error: pasting "/* Must be enabled at startup to keep power flowing*/" and "_WPORT" does not give a valid preprocessing token
#define SUICIDE_PIN 54 // Must be enabled at startup to keep power flowing
^
sketchfastio.h:79:51: note: in definition of macro '_WRITE_C'
{DIO ## IO ## _WPORT |= _BV(DIO ## IO ## _PIN); }
^
sketchfastio.h:102:21: note: in expansion of macro '_WRITE'
#define WRITE(IO,V) _WRITE(IO,V)
^
sketchfastio.h:113:46: note: in expansion of macro 'WRITE'
#define OUT_WRITE(IO, v) do{ SET_OUTPUT(IO); WRITE(IO, v); }while(0)
^
sketchMarlin_main.cpp:914:5: note: in expansion of macro 'OUT_WRITE'
OUT_WRITE(SUICIDE_PIN, HIGH);
^
sketchMarlin_main.cpp:914:15: note: in expansion of macro 'SUICIDE_PIN'
OUT_WRITE(SUICIDE_PIN, HIGH);
^
pins_GT2560_REV_A.h:93:32: error: pasting "/* Must be enabled at startup to keep power flowing*/" and "_PIN" does not give a valid preprocessing token
#define SUICIDE_PIN 54 // Must be enabled at startup to keep power flowing
^
sketchfastio.h:79:78: note: in definition of macro '_WRITE_C'
{DIO ## IO ## _WPORT |= _BV(DIO ## IO ## _PIN); }
^
sketchfastio.h:102:21: note: in expansion of macro '_WRITE'
#define WRITE(IO,V) _WRITE(IO,V)
^
sketchfastio.h:113:46: note: in expansion of macro 'WRITE'
#define OUT_WRITE(IO, v) do{ SET_OUTPUT(IO); WRITE(IO, v); }while(0)
^
sketchMarlin_main.cpp:914:5: note: in expansion of macro 'OUT_WRITE'
OUT_WRITE(SUICIDE_PIN, HIGH);
^
sketchMarlin_main.cpp:914:15: note: in expansion of macro 'SUICIDE_PIN'
OUT_WRITE(SUICIDE_PIN, HIGH);
^
pins_GT2560_REV_A.h:93:32: error: pasting "/* Must be enabled at startup to keep power flowing*/" and "_WPORT" does not give a valid preprocessing token
#define SUICIDE_PIN 54 // Must be enabled at startup to keep power flowing
^
sketchfastio.h:84:51: note: in definition of macro '_WRITE_C'
{DIO ## IO ## _WPORT &= ~_BV(DIO ## IO ## _PIN); }
^
sketchfastio.h:102:21: note: in expansion of macro '_WRITE'
#define WRITE(IO,V) _WRITE(IO,V)
^
sketchfastio.h:113:46: note: in expansion of macro 'WRITE'
#define OUT_WRITE(IO, v) do{ SET_OUTPUT(IO); WRITE(IO, v); }while(0)
^
sketchMarlin_main.cpp:914:5: note: in expansion of macro 'OUT_WRITE'
OUT_WRITE(SUICIDE_PIN, HIGH);
^
sketchMarlin_main.cpp:914:15: note: in expansion of macro 'SUICIDE_PIN'
OUT_WRITE(SUICIDE_PIN, HIGH);
^
pins_GT2560_REV_A.h:93:32: error: pasting "/* Must be enabled at startup to keep power flowing*/" and "_PIN" does not give a valid preprocessing token
#define SUICIDE_PIN 54 // Must be enabled at startup to keep power flowing
^
sketchfastio.h:84:79: note: in definition of macro '_WRITE_C'
{DIO ## IO ## _WPORT &= ~_BV(DIO ## IO ## _PIN); }
^
sketchfastio.h:102:21: note: in expansion of macro '_WRITE'
#define WRITE(IO,V) _WRITE(IO,V)
^
sketchfastio.h:113:46: note: in expansion of macro 'WRITE'
#define OUT_WRITE(IO, v) do{ SET_OUTPUT(IO); WRITE(IO, v); }while(0)
^
sketchMarlin_main.cpp:914:5: note: in expansion of macro 'OUT_WRITE'
OUT_WRITE(SUICIDE_PIN, HIGH);
^
sketchMarlin_main.cpp:914:15: note: in expansion of macro 'SUICIDE_PIN'
OUT_WRITE(SUICIDE_PIN, HIGH);
^
In file included from sketchMarlinConfig.h:26:0,
from sketchMarlin.h:36,
from sketchMarlin_main.cpp:247:
pins_GT2560_REV_A.h:93:32: error: pasting "/* Must be enabled at startup to keep power flowing*/" and "_WPORT" does not give a valid preprocessing token
#define SUICIDE_PIN 54 // Must be enabled at startup to keep power flowing
^
sketchfastio.h:75:48: note: in definition of macro '_WRITE_NC'
#define _WRITE_NC(IO, v) do { if (v) {DIO ## IO ## _WPORT |= _BV(DIO ## IO ## _PIN); } else {DIO ## IO ## _WPORT &= ~_BV(DIO ## IO ## _PIN); }; } while (0)
^
sketchfastio.h:102:21: note: in expansion of macro '_WRITE'
#define WRITE(IO,V) _WRITE(IO,V)
^
sketchfastio.h:113:46: note: in expansion of macro 'WRITE'
#define OUT_WRITE(IO, v) do{ SET_OUTPUT(IO); WRITE(IO, v); }while(0)
^
sketchMarlin_main.cpp:914:5: note: in expansion of macro 'OUT_WRITE'
OUT_WRITE(SUICIDE_PIN, HIGH);
^
sketchMarlin_main.cpp:914:15: note: in expansion of macro 'SUICIDE_PIN'
OUT_WRITE(SUICIDE_PIN, HIGH);
^
pins_GT2560_REV_A.h:93:32: error: pasting "/* Must be enabled at startup to keep power flowing*/" and "_PIN" does not give a valid preprocessing token
#define SUICIDE_PIN 54 // Must be enabled at startup to keep power flowing
^
sketchfastio.h:75:75: note: in definition of macro '_WRITE_NC'
#define _WRITE_NC(IO, v) do { if (v) {DIO ## IO ## _WPORT |= _BV(DIO ## IO ## _PIN); } else {DIO ## IO ## _WPORT &= ~_BV(DIO ## IO ## _PIN); }; } while (0)
^
sketchfastio.h:102:21: note: in expansion of macro '_WRITE'
#define WRITE(IO,V) _WRITE(IO,V)
^
sketchfastio.h:113:46: note: in expansion of macro 'WRITE'
#define OUT_WRITE(IO, v) do{ SET_OUTPUT(IO); WRITE(IO, v); }while(0)
^
sketchMarlin_main.cpp:914:5: note: in expansion of macro 'OUT_WRITE'
OUT_WRITE(SUICIDE_PIN, HIGH);
^
sketchMarlin_main.cpp:914:15: note: in expansion of macro 'SUICIDE_PIN'
OUT_WRITE(SUICIDE_PIN, HIGH);
^
pins_GT2560_REV_A.h:93:32: error: pasting "/* Must be enabled at startup to keep power flowing*/" and "_WPORT" does not give a valid preprocessing token
#define SUICIDE_PIN 54 // Must be enabled at startup to keep power flowing
^
sketchfastio.h:75:104: note: in definition of macro '_WRITE_NC'
#define _WRITE_NC(IO, v) do { if (v) {DIO ## IO ## _WPORT |= _BV(DIO ## IO ## _PIN); } else {DIO ## IO ## _WPORT &= ~_BV(DIO ## IO ## _PIN); }; } while (0)
^
sketchfastio.h:102:21: note: in expansion of macro '_WRITE'
#define WRITE(IO,V) _WRITE(IO,V)
^
sketchfastio.h:113:46: note: in expansion of macro 'WRITE'
#define OUT_WRITE(IO, v) do{ SET_OUTPUT(IO); WRITE(IO, v); }while(0)
^
sketchMarlin_main.cpp:914:5: note: in expansion of macro 'OUT_WRITE'
OUT_WRITE(SUICIDE_PIN, HIGH);
^
sketchMarlin_main.cpp:914:15: note: in expansion of macro 'SUICIDE_PIN'
OUT_WRITE(SUICIDE_PIN, HIGH);
^
In file included from sketchMarlinConfig.h:26:0,
from sketchMarlin.h:36,
from sketchMarlin_main.cpp:247:
pins_GT2560_REV_A.h:93:32: error: pasting "/* Must be enabled at startup to keep power flowing*/" and "_PIN" does not give a valid preprocessing token
#define SUICIDE_PIN 54 // Must be enabled at startup to keep power flowing
^
sketchfastio.h:75:132: note: in definition of macro '_WRITE_NC'
#define _WRITE_NC(IO, v) do { if (v) {DIO ## IO ## _WPORT |= _BV(DIO ## IO ## _PIN); } else {DIO ## IO ## _WPORT &= ~_BV(DIO ## IO ## _PIN); }; } while (0)
^
sketchfastio.h:102:21: note: in expansion of macro '_WRITE'
#define WRITE(IO,V) _WRITE(IO,V)
^
sketchfastio.h:113:46: note: in expansion of macro 'WRITE'
#define OUT_WRITE(IO, v) do{ SET_OUTPUT(IO); WRITE(IO, v); }while(0)
^
sketchMarlin_main.cpp:914:5: note: in expansion of macro 'OUT_WRITE'
OUT_WRITE(SUICIDE_PIN, HIGH);
^
sketchMarlin_main.cpp:914:15: note: in expansion of macro 'SUICIDE_PIN'
OUT_WRITE(SUICIDE_PIN, HIGH);
^
pins_GT2560_REV_A.h:93:32: error: pasting "/* Must be enabled at startup to keep power flowing*/" and "_DDR" does not give a valid preprocessing token
#define SUICIDE_PIN 54 // Must be enabled at startup to keep power flowing
^
sketchfastio.h:95:36: note: in definition of macro '_SET_OUTPUT'
#define _SET_OUTPUT(IO) do {DIO ## IO ## _DDR |= _BV(DIO ## IO ## _PIN); } while (0)
^
sketchfastio.h:113:30: note: in expansion of macro 'SET_OUTPUT'
#define OUT_WRITE(IO, v) do{ SET_OUTPUT(IO); WRITE(IO, v); }while(0)
^
sketchMarlin_main.cpp:927:5: note: in expansion of macro 'OUT_WRITE'
OUT_WRITE(SUICIDE_PIN, LOW);
^
sketchMarlin_main.cpp:927:15: note: in expansion of macro 'SUICIDE_PIN'
OUT_WRITE(SUICIDE_PIN, LOW);
^
pins_GT2560_REV_A.h:93:32: error: pasting "/* Must be enabled at startup to keep power flowing*/" and "_PIN" does not give a valid preprocessing token
#define SUICIDE_PIN 54 // Must be enabled at startup to keep power flowing
^
sketchfastio.h:95:61: note: in definition of macro '_SET_OUTPUT'
#define _SET_OUTPUT(IO) do {DIO ## IO ## _DDR |= _BV(DIO ## IO ## _PIN); } while (0)
^
sketchfastio.h:113:30: note: in expansion of macro 'SET_OUTPUT'
#define OUT_WRITE(IO, v) do{ SET_OUTPUT(IO); WRITE(IO, v); }while(0)
^
sketchMarlin_main.cpp:927:5: note: in expansion of macro 'OUT_WRITE'
OUT_WRITE(SUICIDE_PIN, LOW);
^
sketchMarlin_main.cpp:927:15: note: in expansion of macro 'SUICIDE_PIN'
OUT_WRITE(SUICIDE_PIN, LOW);
^
pins_GT2560_REV_A.h:93:32: error: pasting "/* Must be enabled at startup to keep power flowing*/" and "_RPORT" does not give a valid preprocessing token
#define SUICIDE_PIN 54 // Must be enabled at startup to keep power flowing
^
sketchfastio.h:90:41: note: in definition of macro '_WRITE'
#define _WRITE(IO, v) do { if (&(DIO ## IO ## _RPORT) >= (uint8_t *)0x100) {_WRITE_C(IO, v); } else {_WRITE_NC(IO, v); }; } while (0)
^
sketchfastio.h:113:46: note: in expansion of macro 'WRITE'
#define OUT_WRITE(IO, v) do{ SET_OUTPUT(IO); WRITE(IO, v); }while(0)
^
sketchMarlin_main.cpp:927:5: note: in expansion of macro 'OUT_WRITE'
OUT_WRITE(SUICIDE_PIN, LOW);
^
sketchMarlin_main.cpp:927:15: note: in expansion of macro 'SUICIDE_PIN'
OUT_WRITE(SUICIDE_PIN, LOW);
^
pins_GT2560_REV_A.h:93:32: error: pasting "/* Must be enabled at startup to keep power flowing*/" and "_WPORT" does not give a valid preprocessing token
#define SUICIDE_PIN 54 // Must be enabled at startup to keep power flowing
^
sketchfastio.h:79:51: note: in definition of macro '_WRITE_C'
{DIO ## IO ## _WPORT |= _BV(DIO ## IO ## _PIN); }
^
sketchfastio.h:102:21: note: in expansion of macro '_WRITE'
#define WRITE(IO,V) _WRITE(IO,V)
^
sketchfastio.h:113:46: note: in expansion of macro 'WRITE'
#define OUT_WRITE(IO, v) do{ SET_OUTPUT(IO); WRITE(IO, v); }while(0)
^
sketchMarlin_main.cpp:927:5: note: in expansion of macro 'OUT_WRITE'
OUT_WRITE(SUICIDE_PIN, LOW);
^
sketchMarlin_main.cpp:927:15: note: in expansion of macro 'SUICIDE_PIN'
OUT_WRITE(SUICIDE_PIN, LOW);
^
pins_GT2560_REV_A.h:93:32: error: pasting "/* Must be enabled at startup to keep power flowing*/" and "_PIN" does not give a valid preprocessing token
#define SUICIDE_PIN 54 // Must be enabled at startup to keep power flowing
^
sketchfastio.h:79:78: note: in definition of macro '_WRITE_C'
{DIO ## IO ## _WPORT |= _BV(DIO ## IO ## _PIN); }
^
sketchfastio.h:102:21: note: in expansion of macro '_WRITE'
#define WRITE(IO,V) _WRITE(IO,V)
^
sketchfastio.h:113:46: note: in expansion of macro 'WRITE'
#define OUT_WRITE(IO, v) do{ SET_OUTPUT(IO); WRITE(IO, v); }while(0)
^
sketchMarlin_main.cpp:927:5: note: in expansion of macro 'OUT_WRITE'
OUT_WRITE(SUICIDE_PIN, LOW);
^
sketchMarlin_main.cpp:927:15: note: in expansion of macro 'SUICIDE_PIN'
OUT_WRITE(SUICIDE_PIN, LOW);
^
pins_GT2560_REV_A.h:93:32: error: pasting "/* Must be enabled at startup to keep power flowing*/" and "_WPORT" does not give a valid preprocessing token
#define SUICIDE_PIN 54 // Must be enabled at startup to keep power flowing
^
sketchfastio.h:84:51: note: in definition of macro '_WRITE_C'
{DIO ## IO ## _WPORT &= ~_BV(DIO ## IO ## _PIN); }
^
sketchfastio.h:102:21: note: in expansion of macro '_WRITE'
#define WRITE(IO,V) _WRITE(IO,V)
^
sketchfastio.h:113:46: note: in expansion of macro 'WRITE'
#define OUT_WRITE(IO, v) do{ SET_OUTPUT(IO); WRITE(IO, v); }while(0)
^
sketchMarlin_main.cpp:927:5: note: in expansion of macro 'OUT_WRITE'
OUT_WRITE(SUICIDE_PIN, LOW);
^
sketchMarlin_main.cpp:927:15: note: in expansion of macro 'SUICIDE_PIN'
OUT_WRITE(SUICIDE_PIN, LOW);
^
pins_GT2560_REV_A.h:93:32: error: pasting "/* Must be enabled at startup to keep power flowing*/" and "_PIN" does not give a valid preprocessing token
#define SUICIDE_PIN 54 // Must be enabled at startup to keep power flowing
^
sketchfastio.h:84:79: note: in definition of macro '_WRITE_C'
{DIO ## IO ## _WPORT &= ~_BV(DIO ## IO ## _PIN); }
^
sketchfastio.h:102:21: note: in expansion of macro '_WRITE'
#define WRITE(IO,V) _WRITE(IO,V)
^
sketchfastio.h:113:46: note: in expansion of macro 'WRITE'
#define OUT_WRITE(IO, v) do{ SET_OUTPUT(IO); WRITE(IO, v); }while(0)
^
sketchMarlin_main.cpp:927:5: note: in expansion of macro 'OUT_WRITE'
OUT_WRITE(SUICIDE_PIN, LOW);
^
sketchMarlin_main.cpp:927:15: note: in expansion of macro 'SUICIDE_PIN'
OUT_WRITE(SUICIDE_PIN, LOW);
^
In file included from sketchMarlinConfig.h:26:0,
from sketchMarlin.h:36,
from sketchMarlin_main.cpp:247:
pins_GT2560_REV_A.h:93:32: error: pasting "/* Must be enabled at startup to keep power flowing*/" and "_WPORT" does not give a valid preprocessing token
#define SUICIDE_PIN 54 // Must be enabled at startup to keep power flowing
^
sketchfastio.h:75:48: note: in definition of macro '_WRITE_NC'
#define _WRITE_NC(IO, v) do { if (v) {DIO ## IO ## _WPORT |= _BV(DIO ## IO ## _PIN); } else {DIO ## IO ## _WPORT &= ~_BV(DIO ## IO ## _PIN); }; } while (0)
^
sketchfastio.h:102:21: note: in expansion of macro '_WRITE'
#define WRITE(IO,V) _WRITE(IO,V)
^
sketchfastio.h:113:46: note: in expansion of macro 'WRITE'
#define OUT_WRITE(IO, v) do{ SET_OUTPUT(IO); WRITE(IO, v); }while(0)
^
sketchMarlin_main.cpp:927:5: note: in expansion of macro 'OUT_WRITE'
OUT_WRITE(SUICIDE_PIN, LOW);
^
sketchMarlin_main.cpp:927:15: note: in expansion of macro 'SUICIDE_PIN'
OUT_WRITE(SUICIDE_PIN, LOW);
^
pins_GT2560_REV_A.h:93:32: error: pasting "/* Must be enabled at startup to keep power flowing*/" and "_PIN" does not give a valid preprocessing token
#define SUICIDE_PIN 54 // Must be enabled at startup to keep power flowing
^
sketchfastio.h:75:75: note: in definition of macro '_WRITE_NC'
#define _WRITE_NC(IO, v) do { if (v) {DIO ## IO ## _WPORT |= _BV(DIO ## IO ## _PIN); } else {DIO ## IO ## _WPORT &= ~_BV(DIO ## IO ## _PIN); }; } while (0)
^
sketchfastio.h:102:21: note: in expansion of macro '_WRITE'
#define WRITE(IO,V) _WRITE(IO,V)
^
sketchfastio.h:113:46: note: in expansion of macro 'WRITE'
#define OUT_WRITE(IO, v) do{ SET_OUTPUT(IO); WRITE(IO, v); }while(0)
^
sketchMarlin_main.cpp:927:5: note: in expansion of macro 'OUT_WRITE'
OUT_WRITE(SUICIDE_PIN, LOW);
^
sketchMarlin_main.cpp:927:15: note: in expansion of macro 'SUICIDE_PIN'
OUT_WRITE(SUICIDE_PIN, LOW);
^
pins_GT2560_REV_A.h:93:32: error: pasting "/* Must be enabled at startup to keep power flowing*/" and "_WPORT" does not give a valid preprocessing token
#define SUICIDE_PIN 54 // Must be enabled at startup to keep power flowing
^
sketchfastio.h:75:104: note: in definition of macro '_WRITE_NC'
#define _WRITE_NC(IO, v) do { if (v) {DIO ## IO ## _WPORT |= _BV(DIO ## IO ## _PIN); } else {DIO ## IO ## _WPORT &= ~_BV(DIO ## IO ## _PIN); }; } while (0)
^
sketchfastio.h:102:21: note: in expansion of macro '_WRITE'
#define WRITE(IO,V) _WRITE(IO,V)
^
sketchfastio.h:113:46: note: in expansion of macro 'WRITE'
#define OUT_WRITE(IO, v) do{ SET_OUTPUT(IO); WRITE(IO, v); }while(0)
^
sketchMarlin_main.cpp:927:5: note: in expansion of macro 'OUT_WRITE'
OUT_WRITE(SUICIDE_PIN, LOW);
^
sketchMarlin_main.cpp:927:15: note: in expansion of macro 'SUICIDE_PIN'
OUT_WRITE(SUICIDE_PIN, LOW);
^
In file included from sketchMarlinConfig.h:26:0,
from sketchMarlin.h:36,
from sketchMarlin_main.cpp:247:
pins_GT2560_REV_A.h:93:32: error: pasting "/* Must be enabled at startup to keep power flowing*/" and "_PIN" does not give a valid preprocessing token
#define SUICIDE_PIN 54 // Must be enabled at startup to keep power flowing
^
sketchfastio.h:75:132: note: in definition of macro '_WRITE_NC'
#define _WRITE_NC(IO, v) do { if (v) {DIO ## IO ## _WPORT |= _BV(DIO ## IO ## _PIN); } else {DIO ## IO ## _WPORT &= ~_BV(DIO ## IO ## _PIN); }; } while (0)
^
sketchfastio.h:102:21: note: in expansion of macro '_WRITE'
#define WRITE(IO,V) _WRITE(IO,V)
^
sketchfastio.h:113:46: note: in expansion of macro 'WRITE'
#define OUT_WRITE(IO, v) do{ SET_OUTPUT(IO); WRITE(IO, v); }while(0)
^
sketchMarlin_main.cpp:927:5: note: in expansion of macro 'OUT_WRITE'
OUT_WRITE(SUICIDE_PIN, LOW);
^
sketchMarlin_main.cpp:927:15: note: in expansion of macro 'SUICIDE_PIN'
OUT_WRITE(SUICIDE_PIN, LOW);
^
exit status 1
pasting "/* Must be enabled at startup to keep power flowing*/" and "_DDR" does not give a valid preprocessing token
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Bug 35610
— Pasting «foo» and «(» does not give a valid preprocessing token
Summary:
Pasting «foo» and «(» does not give a valid preprocessing token
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Note |
Post Essentials Only Full Version |
---|
funbotix
Starting Member
0 I’ve used the below code in other (non PIC) projects successfully, but not with my current PIC24 project. #define BLACK «0» When I have code like this in my project, the C30 compiler complains as shown below. char string[40];
#1 |
cawilkie
Administrator
RE: ## preprocessor operator
+1 (1) What you see is correct behaviour. The pre-processor will concatenate strings to form one string, so: «foo» «bar» «baz» is equivalent to «foobarbaz». Also, the ## operator can only be used to form a valid preprocessing token, as validated by the standard (for C89 it is) 3.8.3.3, ## operator
GCC chooses to report this as an error. ## can only be used to form one new token. Typically a JOIN is defined as: #define JOIN2(A,B) A ## B Which allows for macros to be expanded, and then joined. Regards post edited by cawilkie — 2010/03/24 08:49:05 #2 |
zardoz1
Super Member
RE: ## preprocessor operator
+1 (1) I dont think this is a problem in C30 but in the other compiler you are using. The error the compiler generates is correct. The macro #define COLORS(foreground,background) "x1B[3" ## foreground ## ";4" ## background ## "m" Used like: COLORS(RED,YELLOW) Will indeed fill in the value RED and YELLOW and not process this further. To solve this you must not use the concateniting operator ## but the tokenizing operator. So redefine your macro like: #define COLORS(foreground,background) "x1B[3"#foreground";4"#background"m" This will lead to all strings being concatenated. But this is still not what you want, you want the symbols RED and YELLOW to be resolved to their values. For this you need the reparsing feature of the C preprocessor. So what you need is the following: #define REPARSE(a) #a This macro will result in a concatenated string where for RED and YELLOW the respective numeric values are filled in. Good luck and don’t doubt the capabilities of C30 but have a look at your other compiler.
#3
|
crwilliams
Super Member
RE: ## preprocessor operator
0 The responses are correct. If you have K&R 2nd Ed, see section A12 and in particularA12.3 which exactly matches cawilkie’s reply. #4 |
zardoz1
Super Member
RE: ## preprocessor operator
0 And one more thing, In my reparse macro I used the tokenizing operator #. Strictly spoken this is not required since your basic macro’s, BLACK, RED, ….. are already defined as a string. When using the tokenizing operator in my reparse macro, you don’t need to do this. So i.s.o. #define BLACK «0» you can use #define BLACK 0. The advantage might by that this also allows you to use the defines for the basic colors as numeric values in your code. Success Leon (aka zardoz1)
#5
|
funbotix
Starting Member
RE: ## preprocessor operator
0 Wow… thanks for all the super-fast and illuminating responses! I try to learn something new every day, and it looks like today is my lucky day! There’s lot’s of intersting stuff in the responses. Every time I think I’ve got a pretty good handle on macros I learn something new. Dave #6 |
zardoz1
Super Member
RE: ## preprocessor operator
0 The fast response is also caused by the fact that I have a special relation with the preprocessor. Lot’s of people hat it and many many coding standard used in large companies forbid it to be used. Over here in the Netherlands I know of at least one very big international company that uses these rules. I think a lot of this is caused by the fact that the preprocessor is misunderstood. Many people know about the pitfalls. A very well known example is the MAX macro. You probably know this, #define MAX(a,b) (a)>(b)?(a):(b) When using this macro like: m = MAX(i++, j++); either the i++ or the j++ parameter is evaluated twice. And indeed, this is a place where macro’s have an undesired side effect. My opinion is also that using macro’s like these should be banned. But in general, macro’s can be used for many purposes. The purpose you are using it for is great. This I call more the configuration purpose as compared to the algorithm purpose but that’s just a naming convention I use. By the way, the MAX macro has no place when the compiler supports inline functions which generate the same effcient code without the side effect.
#7
|